From 0d88f00c8edd4154c81a5825bd6a253d919954ed Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 6 Mar 2018 16:28:17 +0100 Subject: [PATCH 1/3] [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; }, From 11f460a034f944a09e63de4dfa7fd0c1ed2ce8ad Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 6 Mar 2018 16:28:59 +0100 Subject: [PATCH 2/3] [FIX] display total if there is finally no change --- pos_customer_display/static/src/js/customer_display.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pos_customer_display/static/src/js/customer_display.js b/pos_customer_display/static/src/js/customer_display.js index b633d8db..c22ce8ea 100644 --- a/pos_customer_display/static/src/js/customer_display.js +++ b/pos_customer_display/static/src/js/customer_display.js @@ -278,6 +278,9 @@ openerp.pos_customer_display = function(instance){ change_rounded = change.toFixed(2); this.pos.prepare_text_customer_display('update_payment', {'change': change_rounded}); } + else{ + this.pos.prepare_text_customer_display('addPaymentline', {}) + } return res; }, }); From 77b26c7ba578fea1250eb132ea6ea2cc4ab51bb3 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 6 Mar 2018 16:33:44 +0100 Subject: [PATCH 3/3] [FIX] remove console.log message --- pos_customer_display/static/src/js/customer_display.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/pos_customer_display/static/src/js/customer_display.js b/pos_customer_display/static/src/js/customer_display.js index c22ce8ea..981419b2 100644 --- a/pos_customer_display/static/src/js/customer_display.js +++ b/pos_customer_display/static/src/js/customer_display.js @@ -16,8 +16,6 @@ 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;