[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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user