diff --git a/addons/point_of_sale/static/src/app/screens/receipt_screen/receipt_screen.js b/addons/point_of_sale/static/src/app/screens/receipt_screen/receipt_screen.js index b1da75732a7..7247187bd19 100644 --- a/addons/point_of_sale/static/src/app/screens/receipt_screen/receipt_screen.js +++ b/addons/point_of_sale/static/src/app/screens/receipt_screen/receipt_screen.js @@ -34,7 +34,7 @@ export class ReceiptScreen extends Component { // to send in preparation it is automatically sent if (this.pos.orderPreparationCategories.size) { try { - await this.pos.sendOrderInPreparation(this.currentOrder); + await this.pos.sendOrderInPreparationUpdateLastChange(this.currentOrder); } catch (error) { Promise.reject(error); } diff --git a/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js b/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js index 31dc2f7bc7c..b33c6d99522 100644 --- a/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js +++ b/addons/point_of_sale/static/src/app/screens/ticket_screen/ticket_screen.js @@ -155,7 +155,7 @@ export class TicketScreen extends Component { } if (order && (await this._onBeforeDeleteOrder(order))) { if (Object.keys(order.lastOrderPrepaChange).length > 0) { - await this.pos.sendOrderInPreparation(order, true); + await this.pos.sendOrderInPreparationUpdateLastChange(order, true); } if (order === this.pos.get_order()) { this._selectNextOrder(order); diff --git a/addons/point_of_sale/static/src/app/store/pos_store.js b/addons/point_of_sale/static/src/app/store/pos_store.js index 8d66a36c73a..30b4eba6586 100644 --- a/addons/point_of_sale/static/src/app/store/pos_store.js +++ b/addons/point_of_sale/static/src/app/store/pos_store.js @@ -1711,6 +1711,9 @@ export class PosStore extends Reactive { console.warn("Failed in printing the changes in the order", e); } } + } + async sendOrderInPreparationUpdateLastChange(order, cancelled = false) { + await this.sendOrderInPreparation(order, cancelled); order.updateLastOrderChange(); } closeScreen() { diff --git a/addons/pos_restaurant/static/src/overrides/components/product_screen/actionpad_widget/actionpad_widget.js b/addons/pos_restaurant/static/src/overrides/components/product_screen/actionpad_widget/actionpad_widget.js index 5f0ab700003..bc302594a36 100644 --- a/addons/pos_restaurant/static/src/overrides/components/product_screen/actionpad_widget/actionpad_widget.js +++ b/addons/pos_restaurant/static/src/overrides/components/product_screen/actionpad_widget/actionpad_widget.js @@ -23,7 +23,7 @@ patch(ActionpadWidget.prototype, { if (!this.clicked) { this.clicked = true; try { - await this.pos.sendOrderInPreparation(this.currentOrder); + await this.pos.sendOrderInPreparationUpdateLastChange(this.currentOrder); } finally { this.clicked = false; } diff --git a/addons/pos_restaurant/static/src/overrides/components/product_screen/product_screen.js b/addons/pos_restaurant/static/src/overrides/components/product_screen/product_screen.js index 719e09e684e..c2db9fe57a9 100644 --- a/addons/pos_restaurant/static/src/overrides/components/product_screen/product_screen.js +++ b/addons/pos_restaurant/static/src/overrides/components/product_screen/product_screen.js @@ -34,7 +34,7 @@ patch(ProductScreen.prototype, { return this.pos.config.module_pos_restaurant && this.pos.orderPreparationCategories.size; }, submitOrder() { - this.pos.sendOrderInPreparation(this.pos.get_order()); + this.pos.sendOrderInPreparationUpdateLastChange(this.pos.get_order()); }, get primaryReviewButton() { return (