[FIX] product: if the product has no attribute and you add one without any value, the product is deleted.

This commit is contained in:
Christophe Matthieu 2015-02-11 15:01:20 +01:00
parent 32b4ded242
commit 8518a963e0
1 changed files with 2 additions and 1 deletions

View File

@ -660,7 +660,8 @@ class product_template(osv.osv):
for variant in all_variants:
for value_id in variant_id.value_ids:
temp_variants.append(variant + [int(value_id)])
all_variants = temp_variants
if temp_variants:
all_variants = temp_variants
# 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