diff --git a/addons/product/models/product_attribute.py b/addons/product/models/product_attribute.py index 05351f596a5..8bd2957acbb 100644 --- a/addons/product/models/product_attribute.py +++ b/addons/product/models/product_attribute.py @@ -382,7 +382,8 @@ class ProductTemplateAttributeLine(models.Model): # re-use a value that was archived at a previous step. ptav_to_activate.write({'ptav_active': True}) ptav_to_unlink.write({'ptav_active': False}) - ptav_to_unlink.unlink() + if ptav_to_unlink: + ptav_to_unlink.unlink() ProductTemplateAttributeValue.create(ptav_to_create) self.product_tmpl_id._create_variant_ids()