From cfcf8bb31866b223e97a7ced60e425e1c1cbab4f Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 25 Feb 2016 17:01:10 +0100 Subject: [PATCH] [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 --- addons/product/pricelist.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 69df14f0cb1..4f79a438462 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -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: