From 2d17baa07c771ad53bed5b457554500b0ecaa976 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 5 Apr 2019 13:19:12 +0000 Subject: [PATCH] [FIX] product: archived template When a new `product.template` is imported with `active` set to `False`, the associated `product.product` is active. This is not consistent with what happens in the UI: when a template is archived, all variants are archived. At variant creation, we keep the `active` value of the template. opw-1955116 closes odoo/odoo#32461 Signed-off-by: Nicolas Martinelli (nim) --- addons/product/models/product_template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index afe17aaadad..c4d08003561 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -503,6 +503,7 @@ class ProductTemplate(models.Model): variants_to_create.append({ 'product_tmpl_id': tmpl_id.id, 'attribute_value_ids': [(6, 0, list(value_ids))], + 'active': tmpl_id.active, }) if len(variants_to_create) > 1000: raise UserError(_(