From d84b5d35ac5035d40e69d359bfef9fa3094ab97b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 22 Apr 2015 13:49:14 +0200 Subject: [PATCH] [FIX] product: pricelist on product to apply on template If a product as only one variant, using the product.product or the product.template in the pricelist configuration should have the same effect. This is particulary important for the ecommerce where template without variants do not show the product. Having a pricelist for that product had no effect on the price used in the e-commerce. Fixes #2900, opw 615153 --- addons/product/pricelist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index a74c600b54a..8f458ec2b89 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -272,7 +272,9 @@ 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: + if rule.product_id and \ + (product.product_variant_count > 1 or product.product_variant_ids[0].id != rule.product_id.id): + # product rule acceptable on template if has only one variant continue else: if rule.product_tmpl_id and product.product_tmpl_id.id != rule.product_tmpl_id.id: