From efe263280dd8f6665cf97799dd40b4ea6d64e6b1 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Thu, 4 Feb 2016 11:03:08 +0100 Subject: [PATCH] [FIX] point_of_sale, pos_restaurant: temporary orders pos_restaurant creates temporary orders when splitting the bill. This ensures those are never saved to persistent storage. As soon as the user clicks on the pay button, the order is not considered temporary anymore and will be saved. Closes #10767 Fixes #10350 opw-666141 --- addons/point_of_sale/static/src/js/models.js | 2 +- addons/pos_restaurant/static/src/js/splitbill.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 33910244d5c..22c3b662867 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1526,7 +1526,7 @@ exports.Order = Backbone.Model.extend({ return this; }, save_to_db: function(){ - if (!this.init_locked) { + if (!this.temporary && !this.init_locked) { this.pos.db.save_unpaid_order(this); } }, diff --git a/addons/pos_restaurant/static/src/js/splitbill.js b/addons/pos_restaurant/static/src/js/splitbill.js index 745c8282c20..cce3dcbe490 100644 --- a/addons/pos_restaurant/static/src/js/splitbill.js +++ b/addons/pos_restaurant/static/src/js/splitbill.js @@ -107,6 +107,7 @@ var SplitbillScreenWidget = screens.ScreenWidget.extend({ return; } + delete neworder.temporary; if(full){ this.gui.show_screen('payment');