summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2019-04-24 09:06:51 +0000
committerAntoine Prieels <anp@odoo.com>2019-09-04 13:08:12 +0000
commit5d0afddaf221756378fa5d3cb459fd25aa147f93 (patch)
tree6d511bb1e99449f996a0495bef81eb039218d1ca
parentc03d33b64a342ada21ddd217d9bbceb6ef843b9f (diff)
[FIX] point_of_sale: Too many display updates
Multiple updates were sent to the customer display for each modification of the order lines.
-rw-r--r--addons/point_of_sale/static/src/js/models.js6
-rw-r--r--addons/point_of_sale/static/src/js/screens.js1
2 files changed, 4 insertions, 3 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 1bfe646ebee..de64e9cb139 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -652,6 +652,7 @@ exports.PosModel = Backbone.Model.extend({
var order = new exports.Order({},{pos:this});
this.get('orders').add(order);
this.set('selectedOrder', order);
+ this.send_current_order_to_customer_facing_display();
return order;
},
/**
@@ -2252,9 +2253,6 @@ exports.Order = Backbone.Model.extend({
this.paymentlines.on('remove', function(){ this.save_to_db("paymentline:rem"); }, this);
if (this.pos.config.iface_customer_facing_display) {
- this.orderlines.on('change', this.pos.send_current_order_to_customer_facing_display, this.pos);
- // removing last orderline does not trigger change event
- this.orderlines.on('remove', this.pos.send_current_order_to_customer_facing_display, this.pos);
this.paymentlines.on('change', this.pos.send_current_order_to_customer_facing_display, this.pos);
// removing last paymentline does not trigger change event
this.paymentlines.on('remove', this.pos.send_current_order_to_customer_facing_display, this.pos);
@@ -2655,6 +2653,8 @@ exports.Order = Backbone.Model.extend({
if(line.has_product_lot){
this.display_lot_popup();
}
+
+ this.pos.send_current_order_to_customer_facing_display();
},
get_selected_orderline: function(){
return this.selected_orderline;
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index c988db5cfdb..80ddbde9191 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -551,6 +551,7 @@ var OrderWidget = PosBaseWidget.extend({
selected_orderline.price_manually_set = true;
selected_orderline.set_unit_price(val);
}
+ this.pos.send_current_order_to_customer_facing_display();
}
},
change_selected_order: function() {