From 07a89b8aee7ceeb5bfbe2f467684c196c1a2d9fe Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Fri, 13 Nov 2015 16:07:38 +0100 Subject: [PATCH] [FIX] pos_restaurant: fix customer deselection in the POS The issue was that the deselection button did not appear when setting a customer and then going back into the client list. Now new_client gets reset whenever we hide the clientlist widget, which makes the hide/show deselect button logic work. --- addons/point_of_sale/static/src/js/screens.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index e6c7bb260ca..ce89363dcf9 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -966,7 +966,6 @@ var ClientListScreenWidget = ScreenWidget.extend({ this.renderElement(); this.details_visible = false; this.old_client = this.pos.get_order().get_client(); - this.new_client = this.old_client; this.$('.back').click(function(){ self.gui.back(); @@ -1016,6 +1015,10 @@ var ClientListScreenWidget = ScreenWidget.extend({ self.clear_search(); }); }, + hide: function () { + this._super(); + this.new_client = null; + }, barcode_client_action: function(code){ if (this.editing_client) { this.$('.detail.barcode').val(code.code); @@ -1058,7 +1061,7 @@ var ClientListScreenWidget = ScreenWidget.extend({ clientline = clientline.childNodes[1]; this.partner_cache.cache_node(partner.id,clientline); } - if( partners === this.new_client ){ + if( partner === this.old_client ){ clientline.classList.add('highlight'); }else{ clientline.classList.remove('highlight');