[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:
Olivier Dony
2016-12-14 14:11:10 +01:00
parent c077cd7448
commit 9f5839c35a
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -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(){