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] point_of_sale : get the order_number from the same sequence as SO #162119

Draft
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

yoba-odoo
Copy link
Contributor

Steps to reproduce:
1- Install POS and POS restaurant
2- Activate self ordering
3- Create a self order from the mobile menu
4- Create another order from the Shop POS

Current behavior before PR:
There is a conflict happening in order numbers between Self order and other orders where at some point we might have two orders with the same number. This is happening because when adding the order from Shop we get the sequence number from the JS side in Order class

this.sequence_number = this.pos.pos_session.sequence_number++;
but in case of self order. We get it from ir_sequence
sequence_number = re.findall(r'\d+', ir_sequence_session)[0]
So we don't have a shared sequence between them.

Desired behavior after PR is merged:
We are now getting the sequence number from ir_sequence in both scenarios by fetching the ir_sequence module data when setup the Order JS class.

opw-3809595

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Apr 16, 2024

@yoba-odoo yoba-odoo force-pushed the 17.0-opw-3809595-pos_order_number-yoba branch 2 times, most recently from 6b9b1c7 to c68302c Compare April 16, 2024 17:37
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 16, 2024
@yoba-odoo yoba-odoo force-pushed the 17.0-opw-3809595-pos_order_number-yoba branch 12 times, most recently from 4932316 to 08029de Compare April 22, 2024 00:51
@yoba-odoo yoba-odoo force-pushed the 17.0-opw-3809595-pos_order_number-yoba branch 2 times, most recently from c567f8f to 98c781a Compare April 25, 2024 13:57
Steps to reproduce:
	1- Install POS and POS restaurant
	2- Activate self ordering
	3- Create a self order from the mobile menu
	4- Create another order from the Shop POS

Current behavior before PR:
There is a conflict happening in order numbers between Self order
and other orders where at some point we might have two orders
with the same number. This is happening because when adding the
order from Shop we get the sequence number from the JS side
in Order class
https://github.com/odoo/odoo/blob/d82ffde0b316c52f726c247bf6f3d38e2e73e405/addons/point_of_sale/static/src/app/store/models.js#L1383
but in case of self order. We get it from ir_sequence
https://github.com/odoo/odoo/blob/d82ffde0b316c52f726c247bf6f3d38e2e73e405/addons/pos_self_order/controllers/orders.py#L19
So we don't have a shared sequence between them.

Desired behavior after PR is merged:
We are now getting the sequence number from ir_sequence
in both scenarios by fetching the ir_sequence module data
when setup the Order JS class. Also, handled so many corner
cases to adapt the base change

Also changed a check in EWalletProgramTour2 because there is
a slight change in the behavior. Before when you go back to the
PoS dashboard and click on Continue Selling and enter the PoS session
again it will start counting the sequence number from the start again
this is not the case right now where we continue on the same sequence
until the session gets closed

opw-3809595
@yoba-odoo yoba-odoo force-pushed the 17.0-opw-3809595-pos_order_number-yoba branch from 98c781a to a6191c0 Compare April 26, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants