[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
This commit is contained in:
Nicolas Martinelli
2016-06-22 10:45:33 +02:00
parent be94653462
commit ab94b1fa54
+1 -1
View File
@@ -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