summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-06-07 14:38:09 +0200
committerNicolas Martinelli <nim@odoo.com>2016-06-07 16:03:07 +0200
commit7613cb36d62f6dea93f1d184bb2cd67e14bc0c30 (patch)
tree2f40dd0aafc38a2e9b6c2068e519a165e4759ea9 /addons
parent6b7caa0bc03386356d2c94e60dc427620d943d8f (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/product/pricelist.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py
index d63b1744bb6..a621f5449f5 100644
--- a/addons/product/pricelist.py
+++ b/addons/product/pricelist.py
@@ -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)