[FIX] product: better handle of product template copy with variants

Before this commit, copying a template with variants would not copy the
attributes lines, so it didn't work as expected.

closes odoo/odoo#34128

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Sébastien Theys
2019-06-14 09:02:37 +00:00
parent 4642a6fab8
commit 7316111aaf
+1 -1
View File
@@ -120,7 +120,7 @@ class ProductTemplate(models.Model):
color = fields.Integer('Color Index')
is_product_variant = fields.Boolean(string='Is a product variant', compute='_compute_is_product_variant')
attribute_line_ids = fields.One2many('product.template.attribute.line', 'product_tmpl_id', 'Product Attributes')
attribute_line_ids = fields.One2many('product.template.attribute.line', 'product_tmpl_id', 'Product Attributes', copy=True)
valid_product_template_attribute_line_ids = fields.Many2many('product.template.attribute.line',
compute="_compute_valid_attributes", string='Valid Product Attribute Lines', help="Technical compute")