Skip to content
Permalink
Browse files

[IMP] POS : Allow to set default category from the available category.

  • Loading branch information...
jir-odoo committed Mar 19, 2019
1 parent 55c8ae3 commit a451d4deb19af87c10cc81dc534d6a2572cac81c
Showing with 5 additions and 1 deletion.
  1. +4 −0 addons/point_of_sale/models/pos_config.py
  2. +1 −1 addons/point_of_sale/views/pos_config_view.xml
@@ -322,10 +322,14 @@ def _onchange_start_category(self):

@api.onchange('limit_categories', 'iface_available_categ_ids', 'iface_start_categ_id')
def _onchange_limit_categories(self):
res = {}
if not self.limit_categories:
self.iface_available_categ_ids = False
elif self.iface_start_categ_id not in self.iface_available_categ_ids:
self.iface_start_categ_id = False
if self.iface_available_categ_ids:
res = {'domain': {'iface_start_categ_id': [('id', 'in', self.iface_available_categ_ids.ids)]}}
return res

@api.onchange('is_header_or_footer')
def _onchange_header_footer(self):
@@ -128,7 +128,7 @@
Start selling from a default product category
</div>
<div class="content-group mt16" attrs="{'invisible': [('start_category', '=', False)]}">
<field name="iface_start_categ_id" domain="[('id', 'in', iface_start_categ_domain_ids)]"/>
<field name="iface_start_categ_id"/>
</div>
</div>
</div>

0 comments on commit a451d4d

Please sign in to comment.
You can’t perform that action at this time.