diff --git a/sale_quotation_products/models/product_product.py b/sale_quotation_products/models/product_product.py index 2bccaa9d6..6e9fc89fb 100644 --- a/sale_quotation_products/models/product_product.py +++ b/sale_quotation_products/models/product_product.py @@ -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)) @@ -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(