[FIX] product: pricelist applied on product categories

This is related to revision 2ebbcba33a

The above revision introduces a regression: the ability
to configure pricelist items applied on product categories.

If you configured a pricelist with items applied
on products categories, then the first item with a product
category matched all products, even if the products were
not in the according category.

This is because the condition checking that the product
is within the pricelist item product category has been
completely removed, by the above commit.

opw-666059
This commit is contained in:
Denis Ledoux
2016-01-19 12:14:32 +01:00
parent 365e298fb1
commit b52467afb2
+9
View File
@@ -193,6 +193,15 @@ class product_pricelist(osv.osv):
if rule.product_id and product.id != rule.product_id.id:
continue
if rule.categ_id:
cat = product.categ_id
while cat:
if cat.id == rule.categ_id.id:
break
cat = cat.parent_id
if not cat:
continue
if rule.base == 'pricelist' and rule.base_pricelist_id:
price_tmp = self._price_get_multi(cr, uid, rule.base_pricelist_id, [(product, qty, partner)], context=context)[product.id]
ptype_src = rule.base_pricelist_id.currency_id.id