From 7316111aafbf4740ded06376c635a722add8bfbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Fri, 14 Jun 2019 09:02:37 +0000 Subject: [PATCH] [FIX] product: better handle of product template copy with variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/product/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index b249acb9fda..2c73d248a92 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -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")