Skip to content
Permalink
Browse files

[FIX] pos: Too many customer display updates

Updates to the customer display were sent too often:
 - Twice when creating a new order
 - Twice when removing a payment line
 - Every time the status of a payment line with a terminal changed

closes #39179

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
  • Loading branch information...
aprieels committed Oct 22, 2019
1 parent 21ea9d4 commit b72b08cf090acd88a74e57e0e5583e0d803659c0
Showing with 2 additions and 5 deletions.
  1. +2 −5 addons/point_of_sale/static/src/js/models.js
@@ -674,9 +674,6 @@ exports.PosModel = Backbone.Model.extend({
var order = new exports.Order({},{pos:this});
this.get('orders').add(order);
this.set('selectedOrder', order);
if (this.config.iface_customer_facing_display) {
this.send_current_order_to_customer_facing_display();
}
return order;
},
/**
@@ -2153,6 +2150,7 @@ exports.Paymentline = Backbone.Model.extend({
set_amount: function(value){
this.order.assert_editable();
this.amount = round_di(parseFloat(value) || 0, this.pos.currency.decimals);
this.pos.send_current_order_to_customer_facing_display();
this.trigger('change',this);
},
// returns the amount of money on this paymentline
@@ -2271,8 +2269,7 @@ 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.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('add', this.pos.send_current_order_to_customer_facing_display, this.pos);
this.paymentlines.on('remove', this.pos.send_current_order_to_customer_facing_display, this.pos);
}

0 comments on commit b72b08c

Please sign in to comment.
You can’t perform that action at this time.