diff options
| author | Simon Lejeune <sle@openerp.com> | 2019-12-06 10:14:40 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2019-12-06 10:14:40 +0000 |
| commit | bc9fdfff88fc05a5241e1b58e7256e4d810d4b90 (patch) | |
| tree | e2f64f3e4229c49acf6f2d2dc409a09fa4d99510 /addons/product/views | |
| parent | a8f6b4ce9cf1bc31291b26874371973b029ebf0b (diff) | |
[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>
Diffstat (limited to 'addons/product/views')
| -rw-r--r-- | addons/product/views/product_template_views.xml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/product/views/product_template_views.xml b/addons/product/views/product_template_views.xml index 0d8ebcf0a1b..15a4f1fb5d7 100644 --- a/addons/product/views/product_template_views.xml +++ b/addons/product/views/product_template_views.xml @@ -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"/> |
