[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.
This commit is contained in:
Joren Van Onder
2015-11-19 08:35:23 +01:00
parent cdc71ba9a7
commit 07a89b8aee
@@ -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');