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
[FW][FIX] pos_restaurant: don't clear order after printing bill #159530
[FW][FIX] pos_restaurant: don't clear order after printing bill #159530
Conversation
@AH-Yussef @caburj this PR targets master and is the last of the forward-port chain containing: To merge the full chain, use
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@fw-bot r+ |
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
@AH-Yussef @caburj staging failed: ci/runbot (view more at https://runbot.odoo.com/runbot/build/60617760) |
ea7fff7
to
2b278d5
Compare
@AH-Yussef @caburj this PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo) |
@robodoo r+ |
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 X-original-commit: 37ce3e5
2b278d5
to
566dd53
Compare
@robodoo r+ |
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes #159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce: - Install Restaurant app. - Go to Point of Sale app and open a new Restaurant session. - Add items to the order. - Click on the Bill button, the reeceipt window appears. - Click on the Print button, the print window appears. Cancel it - U don't have to print it or save it-. - Close the reeceipt window. - Add another item to the order, the older items are removed -the order is cleared-. Investigation: - When the Print button is clicked in the Bill Screen, `print()` method is triggered https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L16-L19 - which do two actions simultaneously: - calls the `printReceipt()` method https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L17 - set the order.`_printed` to `false` https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js#L18 NOW order.`_printed` IS FALSE. - Inside the `printReceipt()` method, we reach this line https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/pos_store.js#L1793 which set the order.`_printed` to True. NOW order.`_printed` IS TRUE. - When a new product is added to the order, this if clause https://github.com/odoo/odoo/blob/c3fe6dfd3c56ae8058d0eb688680bdc627ee611a/addons/point_of_sale/static/src/app/store/models.js#L1871-L1875 is activated given that the order.`_printed` is true although it should have been false! opw-3796605 closes odoo#159530 X-original-commit: 37ce3e5 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
Steps to reproduce:
Investigation:
print()
method is triggeredodoo/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js
Lines 16 to 19 in c3fe6df
printReceipt()
methododoo/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js
Line 17 in c3fe6df
_printed
tofalse
odoo/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js
Line 18 in c3fe6df
_printed
IS FALSE.printReceipt()
method, we reach this lineodoo/addons/point_of_sale/static/src/app/store/pos_store.js
Line 1793 in c3fe6df
_printed
to True. NOW order._printed
IS TRUE.odoo/addons/point_of_sale/static/src/app/store/models.js
Lines 1871 to 1875 in c3fe6df
_printed
is true although it should have beenfalse
!opw-3796605
Forward-Port-Of: #158516