[FIX] product: avoid traceback when product had no variant.
Compute price with a product template without product product raises a traceback: index out of tuple
This commit is contained in:
parent
0eb9772ab8
commit
cfcf8bb318
|
@ -277,8 +277,7 @@ class product_pricelist(osv.osv):
|
|||
if is_product_template:
|
||||
if rule.product_tmpl_id and product.id != rule.product_tmpl_id.id:
|
||||
continue
|
||||
if rule.product_id and \
|
||||
(product.product_variant_count > 1 or product.product_variant_ids[0].id != rule.product_id.id):
|
||||
if rule.product_id and not (product.product_variant_count == 1 and product.product_variant_ids[0].id == rule.product_id.id):
|
||||
# product rule acceptable on template if has only one variant
|
||||
continue
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue