From 0ddb06b5ecce434a60c3272fcc403f8d013a69c7 Mon Sep 17 00:00:00 2001 From: Robin Heinz Date: Thu, 4 Mar 2021 09:49:21 +0000 Subject: [PATCH] [FIX] pos_restaurant: Fix bill receipt When bill printing, the order was done instead of just going back to the order. Now we don't validate the order anymore when showing the printbill receipt screen anymore. closes odoo/odoo#72142 X-original-commit: 0e8d86238e56d7a248af340e13036444b0e49d4e Related: odoo/enterprise#19007 Signed-off-by: pimodoo --- .../static/src/js/Screens/ReceiptScreen/ReceiptScreen.js | 5 ++++- addons/pos_restaurant/static/src/js/Screens/BillScreen.js | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js b/addons/point_of_sale/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js index 376def9e443..8d4bfafcb99 100644 --- a/addons/point_of_sale/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js @@ -63,6 +63,9 @@ odoo.define('point_of_sale.ReceiptScreen', function (require) { get nextScreen() { return { name: 'ProductScreen' }; } + whenClosing() { + this.orderDone(); + } /** * This function is called outside the rendering call stack. This way, * we don't block the displaying of ReceiptScreen when it is mounted; additionally, @@ -72,7 +75,7 @@ odoo.define('point_of_sale.ReceiptScreen', function (require) { if (this._shouldAutoPrint()) { await this.printReceipt(); if (this.currentOrder._printed && this._shouldCloseImmediately()) { - this.orderDone(); + this.whenClosing(); } } } diff --git a/addons/pos_restaurant/static/src/js/Screens/BillScreen.js b/addons/pos_restaurant/static/src/js/Screens/BillScreen.js index 7b7c5b0f8b9..ed9832e479b 100644 --- a/addons/pos_restaurant/static/src/js/Screens/BillScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/BillScreen.js @@ -10,6 +10,9 @@ odoo.define('pos_restaurant.BillScreen', function (require) { this.props.resolve({ confirmed: true, payload: null }); this.trigger('close-temp-screen'); } + whenClosing() { + this.confirm(); + } } BillScreen.template = 'BillScreen'; return BillScreen;