summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js')
-rw-r--r--addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js12
1 files changed, 12 insertions, 0 deletions
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 689c3bf40ca..5909292e0db 100644
--- a/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js
+++ b/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js
@@ -20,6 +20,18 @@ odoo.define('pos_restaurant.ReceiptScreen', function(require) {
return super.nextScreen;
}
}
+ /**
+ * If this order is synced to/from the server, then the draft needs to be deleted
+ * after the order is paid and the receipt screen is exited via 'Next Order' button.
+ * Thus, we set this order to be removed from server. Note that only the draft version
+ * is deleted if we trace the algorithm.
+ */
+ orderDone() {
+ if (this.env.pos.config.iface_floorplan) {
+ this.env.pos.db.set_order_to_remove_from_server(this.currentOrder);
+ }
+ super.orderDone();
+ }
};
Registries.Component.extend(ReceiptScreen, PosResReceiptScreen);