Skip to content

Commit

Permalink
[FIX] - add brand_use_level to fields_view_get fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Feb 25, 2022
1 parent 8bbf8be commit d5b4b31
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions brand/models/res_brand_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ def fields_view_get(

if view_type in ['tree', 'form']:
doc = etree.XML(result['arch'])
modifiers = self.fields_get(['brand_use_level'])['brand_use_level']
result['fields']['brand_use_level'] = modifiers
elem = etree.Element(
'field', {'name': 'brand_use_level', 'invisible': 'True'}
)
orm.setup_modifiers(elem, modifiers)
for node in doc.xpath("//field[@name='brand_id']"):
elem = etree.Element(
'field', {'name': 'brand_use_level', 'invisible': 'True'}
)
orm.setup_modifiers(
elem,
self.fields_get(['brand_use_level'])['brand_use_level'],
)
node.addprevious(elem)
node.set(
'attrs',
Expand Down

0 comments on commit d5b4b31

Please sign in to comment.