Skip to content

Commit

Permalink
[FIX] sale_quotation_products: make all fields not editable
Browse files Browse the repository at this point in the history
  • Loading branch information
vib-adhoc authored and jjscarafia committed Apr 17, 2023
1 parent b61c7db commit 4eb19cd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sale_quotation_products/models/product_product.py
Expand Up @@ -117,10 +117,8 @@ def _get_view(self, view_id=None, view_type='form', **options):
if sale_quotation_products and view_type == 'tree':
# make all fields not editable
for node in arch.xpath("//field[@name]"):
if not node.get("modifiers"):
continue
node.set('readonly', '1')
modifiers = json.loads(node.get("modifiers"))
modifiers = json.loads(node.get("modifiers") or "{}")
modifiers['readonly'] = True
node.set("modifiers", json.dumps(modifiers))

Expand All @@ -141,7 +139,7 @@ def _get_view(self, view_id=None, view_type='form', **options):
'icon': 'fa-plus',
'title': _('Add one'),
}))

# add button tu open form
placeholder = arch.xpath("//tree")[0]
placeholder.append(
Expand Down

0 comments on commit 4eb19cd

Please sign in to comment.