Skip to content
Snippets Groups Projects
Commit 7613cb36 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] product: pricelist based on supplier price

In the case of a purchase pricelist based on the supplier price, the
price selected is incorrect if the supplier is not in the list of
suppliers of the product. Indeed, in this case, the price of the first
supplier is chosen.

We also need to make sure to go through all the pricelist items found.

opw-678440
parent 6b7caa0b
No related branches found
No related tags found
No related merge requests found
......@@ -312,7 +312,8 @@ class product_pricelist(osv.osv):
if (not partner) or (seller_id.name.id != partner):
continue
seller = seller_id
if not seller and product.seller_ids:
# DO NOT FORWARDPORT
if not seller and product.seller_ids and rule.price_version_id.pricelist_id.type == 'sale':
seller = product.seller_ids[0]
if seller:
qty_in_seller_uom = qty
......@@ -359,7 +360,7 @@ class product_pricelist(osv.osv):
price = min(price, price_limit + price_max_margin)
rule_id = rule.id
break
break
# Final price conversion to target UoM
price = product_uom_obj._compute_price(cr, uid, price_uom_id, price, qty_uom_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment