[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-04-05 14:14:59 +00:00
parent 0f971130d6
commit 2d17baa07c
@@ -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(_(