diff options
| author | Antoine Prieels <anp@odoo.com> | 2019-10-22 12:37:50 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-11-08 12:19:54 +0000 |
| commit | 931da033a5bad5b5e54576468b8cfe894b69cf3c (patch) | |
| tree | 11c0c32571a9edab1b3f02980fd1357ed7f5297f | |
| parent | 68b0f9cb6531518a31f37dd22dc419671d6f583c (diff) | |
[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 odoo/odoo#40024
X-original-commit: b72b08cf090acd88a74e57e0e5583e0d803659c0
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 6a47c704efb..4a5b9a86fde 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -680,9 +680,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; }, /** @@ -2159,6 +2156,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 @@ -2285,8 +2283,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); } |
