From 0cd34718bd98fbddc9a40c6d89119b4fc8311e37 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Fri, 23 Sep 2016 15:02:08 +0200 Subject: [PATCH] Revert "[FIX] product: remove empty variant on first attribute add" This reverts commit 20e19fdf850f41ad908bc205c67f88af1a012db3. Already fixed by @fwi-odoo in 82b83ac --- addons/product/models/product_template.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index 008e9dda299..db3d2d81ce0 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -375,12 +375,6 @@ class ProductTemplate(models.Model): variant_matrix = itertools.product(*(line.value_ids for line in tmpl_id.attribute_line_ids if line.value_ids and line.value_ids[0].attribute_id.create_variant)) variant_matrix = map(lambda record_list: reduce(lambda x, y: x+y, record_list, self.env['product.attribute.value']), variant_matrix) to_create_variants = filter(lambda rec_set: set(rec_set.ids) not in existing_variants, variant_matrix) - - # archive dummy variant - if len(existing_variants) > 0: - for variant in tmpl_id.product_variant_ids: - if len(variant.attribute_value_ids.ids) == 0: - variant.write({'active': False}) # adding an attribute with only one value should not recreate product # write this attribute on every product to make sure we don't lose them