diff --git a/static/src/app/services/pos_store.js b/static/src/app/services/pos_store.js index a4d870d..ce1d140 100644 --- a/static/src/app/services/pos_store.js +++ b/static/src/app/services/pos_store.js @@ -7,7 +7,17 @@ import { NumberPopup } from "@point_of_sale/app/components/popups/number_popup/n import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog"; patch(PosStore.prototype, { + async transferOrder(orderUuid, destinationTable = null, destinationOrder = null) { + this.transferDestinationTable = destinationTable; + return super.transferOrder(...arguments); + }, + async setTableFromUi(table, orderUuid = null) { + if (this.transferDestinationTable && this.transferDestinationTable.id === table.id) { + this.transferDestinationTable = null; + return super.setTableFromUi(...arguments); + } + if (!this.config.module_pos_restaurant || this.isOrderTransferMode) { return super.setTableFromUi(...arguments); } @@ -18,7 +28,11 @@ patch(PosStore.prototype, { } this.setCashier(cashier); - await super.setTableFromUi(...arguments); + try { + await super.setTableFromUi(...arguments); + } finally { + this.transferDestinationTable = null; + } const order = this.getOrder(); if (order) {