From 0d88f00c8edd4154c81a5825bd6a253d919954ed Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 6 Mar 2018 16:28:17 +0100 Subject: [PATCH] [FIX) incompatibility between pos_pricelist and pos_customer_display courtesy @gaelTorrecillas #210 --- .../static/src/js/customer_display.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pos_customer_display/static/src/js/customer_display.js b/pos_customer_display/static/src/js/customer_display.js index e16c3472..b633d8db 100644 --- a/pos_customer_display/static/src/js/customer_display.js +++ b/pos_customer_display/static/src/js/customer_display.js @@ -16,6 +16,8 @@ openerp.pos_customer_display = function(instance){ module.PosModel = module.PosModel.extend({ prepare_text_customer_display: function(type, data){ + console.log("prepare_text_customer_display"); + console.log(data); if (this.config.iface_customer_display != true) return; var line_length = this.config.customer_display_line_length || 20; @@ -200,7 +202,9 @@ openerp.pos_customer_display = function(instance){ var res = OrderlineSuper.prototype.set_quantity.call(this, quantity); if (quantity != 'remove') { var line = this; - this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + if(this.selected){ + this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + } } return res; }, @@ -209,7 +213,9 @@ openerp.pos_customer_display = function(instance){ var res = OrderlineSuper.prototype.set_discount.call(this, discount); if (discount) { var line = this; - this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + if(this.selected){ + this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + } } return res; }, @@ -217,7 +223,9 @@ openerp.pos_customer_display = function(instance){ set_unit_price: function(price){ var res = OrderlineSuper.prototype.set_unit_price.call(this, price); var line = this; - this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + if(this.selected){ + this.pos.prepare_text_customer_display('add_update_line', {'line': line}); + } return res; },