summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren Van Onder <jov@odoo.com>2016-02-04 11:03:08 +0100
committerNicolas Martinelli <nim@odoo.com>2016-02-04 11:50:21 +0100
commitefe263280dd8f6665cf97799dd40b4ea6d64e6b1 (patch)
tree0135292c6e4fbdc42c802ca3165bb9f2757a2053
parentcf8b05a16d5e9ee466d8ff6e51fc53b9a7982b5e (diff)
[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
-rw-r--r--addons/point_of_sale/static/src/js/models.js2
-rw-r--r--addons/pos_restaurant/static/src/js/splitbill.js1
2 files changed, 2 insertions, 1 deletions
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');