Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] fiscal_epos_print: new order lines not saved when changing table on Point of sale when restaurant tables are enabled #4623

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

micheledic
Copy link
Contributor

@micheledic micheledic commented Feb 19, 2025

This PR fixes an issue on Point of sale using tables and restaurant
It improves also the code using "some" instead of "find"
Fixes #4624

@OCA-git-bot
Copy link
Contributor

Hi @eLBati,
some modules you are maintaining are being modified, check this out!

@micheledic
Copy link
Contributor Author

micheledic commented Feb 19, 2025

Errore della build unrelated

EDIT: ho incluso un commit che fixa anche i test che falliscono su l10n_it_account_stamp

@micheledic micheledic force-pushed the 16.0_fix_fiscal_epos_print_tables branch 2 times, most recently from 0f66053 to f0a8be9 Compare February 19, 2025 12:00
@eLBati eLBati assigned eLBati and unassigned eLBati Feb 19, 2025
@Wvven
Copy link

Wvven commented Feb 19, 2025

LGTM

…e on Point of sale when restaurant tables are enabled
@micheledic micheledic force-pushed the 16.0_fix_fiscal_epos_print_tables branch 2 times, most recently from f0a8be9 to cf8f798 Compare February 23, 2025 19:00
@micheledic
Copy link
Contributor Author

rebased per applicare #4529, ora dovrebbe essere apposto ;)

Copy link
Contributor

@TheMule71 TheMule71 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@robyf70 robyf70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TheMule71
Copy link
Contributor

Ho solo una domanda prima di mergiare, mi sfugge in base a quale meccanismo fixa la issue #4624
(premetto che non ho familiarità col JS del POS).

Vedo che impatta un flag (has_refund) sull'ordine se almeno una riga ha una qta negativa, in che modo però il vecchio codice impediva il salvataggio delle righe come da issue? La issue non nomina refund.

Non capisco come le due cose siano collegate.

@micheledic
Copy link
Contributor Author

Ho solo una domanda prima di mergiare, mi sfugge in base a quale meccanismo fixa la issue #4624 (premetto che non ho familiarità col JS del POS).

Vedo che impatta un flag (has_refund) sull'ordine se almeno una riga ha una qta negativa, in che modo però il vecchio codice impediva il salvataggio delle righe come da issue? La issue non nomina refund.

Non capisco come le due cose siano collegate.

E' molto strano come bug, se in quella funzione fa la find per verificare se c'è un reso , successivamente pusha al server sempre e solo le righe inserite inizialmente . E' come se lato js, dopo aver acceduto alle lines per fare la find, nel momento del push delle righe al server accedesse sempre alla cache appena inizializzata delle orderlines e non alle righe effettivamente inserite. (infatti nei logs si vedono delle pos.order.line eliminate quando si cambia tavolo)

Per essere certo che sia quella la parte di codice incriminata, inizialmente avevo provato a forzare has_refund = True cosi non facendogli fare la find e il problema non si presentava .

Con some, comunque, personalmente ritengo sia anche molto più elegante oltre che risolvere il problema

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@micheledic
Copy link
Contributor Author

Ho solo una domanda prima di mergiare, mi sfugge in base a quale meccanismo fixa la issue #4624 (premetto che non ho familiarità col JS del POS).

Vedo che impatta un flag (has_refund) sull'ordine se almeno una riga ha una qta negativa, in che modo però il vecchio codice impediva il salvataggio delle righe come da issue? La issue non nomina refund.

Non capisco come le due cose siano collegate.

Si può mergiare ?

@francesco-ooops
Copy link
Contributor

@TheMule71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] fiscal_epos_print: new order lines are not saved changing the current table on a Pos restaurant setup
7 participants