[FIX] point_of_sale: Too many display updates

Multiple updates were sent to the customer display for each
modification of the order lines.
This commit is contained in:
Antoine Prieels
2019-09-04 13:08:12 +00:00
parent c03d33b64a
commit 5d0afddaf2
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -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;
@@ -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() {