[FIX] point_of_sale: prevent removing order after bill screen timeout

steps to reproduce the issue:
-Navigate to POS, Open Bar (needs to be restaurant POS)
-Click on a table and add some items to the order.
-Click the Bill button under the order
-Wait about 90 seconds
-Bill page times out and goes back to the floor screen
-Click on Orders at the top and view Ongoing Orders. The one you just
made is not here (it should be)

The solution is to prevent removing the not finalized order when
coming back to the FloorScreen.

opw-3276345

closes odoo/odoo#124960

X-original-commit: be384e27ced7c256867938c53aa5d2a7d81c0ade
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
pedrambiria
2023-06-14 10:54:53 +02:00
parent c31beb459d
commit 88124fcf60
@@ -10,7 +10,7 @@ patch(ReceiptScreen.prototype, "pos_restaurant.ReceiptScreen", {
this._super(...arguments);
onWillUnmount(() => {
// When leaving the receipt screen to the floor screen the order is paid and can be removed
if (this.pos.mainScreen.component === FloorScreen) {
if (this.pos.mainScreen.component === FloorScreen && this.currentOrder.finalized) {
this.pos.globalState.removeOrder(this.currentOrder);
}
});