From 88124fcf60fb7243fa52d662988788a80615453e Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Thu, 4 May 2023 11:02:46 +0000 Subject: [PATCH] [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) Signed-off-by: Pedram Bi Ria (pebr) --- .../static/src/js/Screens/ReceiptScreen/ReceiptScreen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js b/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js index 55f4e6d6d74..ec80d79f252 100644 --- a/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js @@ -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); } });