[IMP] point_of_sale: allow to specify the product category displayed by default

This commit is contained in:
Frédéric van der Essen
2015-02-02 16:29:31 +01:00
parent a84cadcf0a
commit 45d6b58d7b
3 changed files with 5 additions and 2 deletions
+1
View File
@@ -77,6 +77,7 @@ class pos_config(osv.osv):
'iface_print_auto': fields.boolean('Automatic Receipt Printing', help='The receipt will automatically be printed at the end of each order'),
'iface_precompute_cash': fields.boolean('Prefill Cash Payment', help='The payment input will behave similarily to bank payment input, and will be prefilled with the exact due amount'),
'iface_tax_included': fields.boolean('Include Taxes in Prices', help='The displayed prices will always include all taxes, even if the taxes have been setup differently'),
'iface_start_categ_id': fields.many2one('pos.category','Start Category', help='The point of sale will display this product category by default. If no category is specified, all available products will be shown'),
'receipt_header': fields.text('Receipt Header',help="A short text that will be inserted as a header in the printed receipt"),
'receipt_footer': fields.text('Receipt Footer',help="A short text that will be inserted as a footer in the printed receipt"),
'proxy_ip': fields.char('IP Address', help='The hostname or ip address of the hardware proxy, Will be autodetected if left empty', size=45),
@@ -699,6 +699,7 @@
<field name="iface_vkeyboard" />
<field name="iface_invoicing" />
<field name="iface_precompute_cash" />
<field name="iface_start_categ_id" />
</group>
<group>
<field name="iface_fullscreen" />
@@ -548,7 +548,8 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ //
this.subcategories = [];
this.product_list_widget = options.product_list_widget || null;
this.category_cache = new module.DomCache();
this.set_category();
this.start_categ_id = this.pos.config.iface_start_categ_id ? this.pos.config.iface_start_categ_id[0] : 0;
this.set_category(this.pos.db.get_category_by_id(this.start_categ_id));
this.switch_category_handler = function(event){
self.set_category(self.pos.db.get_category_by_id(Number(this.dataset['categoryId'])));
@@ -685,7 +686,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ //
// resets the current category to the root category
reset_category: function(){
this.set_category();
this.set_category(this.pos.db.get_category_by_id(this.start_categ_id));
this.renderElement();
},