[FIX] product: multi edit barcode field on template

Writing barcode on a template will only write it on the variants if the
variant count is 1. Make the field readonly on the view according to
this condition.

closes odoo/odoo#41489

X-original-commit: a67ad076f4c079f33602f01ed2b8cbf741aeffc5
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Simon Lejeune
2019-12-06 10:14:40 +00:00
parent a8f6b4ce9c
commit bc9fdfff88
@@ -5,9 +5,11 @@
<field name="model">product.template</field>
<field name="arch" type="xml">
<tree string="Product" multi_edit="1">
<field name="product_variant_count" invisible="1"/>
<field name="sequence" widget="handle" readonly="1"/>
<field name="default_code" optional="show"/>
<field name="barcode" optional="hide"/>
<field name="barcode" optional="hide" attrs="{'readonly': [('product_variant_count', '>', 1)]}"/>
<field name="name"/>
<field name="company_id" options="{'no_create_edit': True}"
groups="base.group_multi_company" optional="hide"/>