[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
This commit is contained in:
Martin Trigaux 2015-04-22 13:49:14 +02:00
parent bbe1845727
commit d84b5d35ac
1 changed files with 3 additions and 1 deletions

View File

@ -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: