From ab94b1fa549da6f8b8d558ce517c44fe45904ecc Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 22 Jun 2016 10:22:17 +0200 Subject: [PATCH] [FIX] purchase: pricelist based on supplier price DO NOT FORWARDPORT! If a purchase pricelist depends on the supplier price, the purchase price in a PO automatically from procurements will be zero. It was (partially) working before 7613cb3 by luck since the price of the first supplier was chosen by default if no supplier was found. In fact, the condition `seller_id.name.id != partner` requires the `partner` to be an ID, not a browse record. opw-681105 --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 9eb40328d45..58374659fe9 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1468,7 +1468,7 @@ class procurement_order(osv.osv): qty[procurement.product_id.id] = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id) if seller_qty: qty[procurement.product_id.id] = max(qty[procurement.product_id.id], seller_qty) - prices_qty += [(procurement.product_id, qty[procurement.product_id.id], partner)] + prices_qty += [(procurement.product_id, qty[procurement.product_id.id], partner.id)] prices = pricelist_obj.price_get_multi(cr, uid, [pricelist_id], prices_qty, context=context) #Passing partner_id to context for purchase order line integrity of Line name