[FIX] point_of_sale: do not reset selected category every time
There seems to be no need to reset to the root category on the product list every time we switch back to the list from another screen. Unless a full refresh was requested (e.g after closing an order). This avoids losing the currently selected category after each screen switch. It can be quite convenient to stay in the same category while the cashier is processing items that need to be weighed, for example. This commit allows POS screen widgets to distinguish when the user is expecting a full reset of the target screen, vs. simply re-displaying it.
This commit is contained in:
@@ -114,7 +114,7 @@ var Gui = core.Class.extend({
|
||||
this.current_screen.hide();
|
||||
}
|
||||
this.current_screen = screen;
|
||||
this.current_screen.show();
|
||||
this.current_screen.show(refresh);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -938,10 +938,12 @@ var ProductScreenWidget = ScreenWidget.extend({
|
||||
}
|
||||
},
|
||||
|
||||
show: function(){
|
||||
show: function(reset){
|
||||
this._super();
|
||||
this.product_categories_widget.reset_category();
|
||||
this.numpad.state.reset();
|
||||
if (reset) {
|
||||
this.product_categories_widget.reset_category();
|
||||
this.numpad.state.reset();
|
||||
}
|
||||
},
|
||||
|
||||
close: function(){
|
||||
|
||||
Reference in New Issue
Block a user