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;