From 2fbecc4238c0eecd0e1afbf490f9660a2c3a7d11 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 19 Jan 2011 02:17:24 +0100 Subject: [PATCH] [FIX] purchase: default value of partial picking wizard was crashing because of deprecated code lp bug: https://launchpad.net/bugs/704652 fixed bzr revid: qdp-launchpad@tinyerp.com-20110119011724-mrn0xam9cs0gmyc7 --- addons/purchase/stock.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index e32528f985d..f8f21428540 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -143,8 +143,12 @@ class stock_partial_picking(osv.osv_memory): if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id: # We use the original PO unit purchase price as the basis for the cost, expressed # in the currency of the PO (i.e the PO's pricelist currency) - res['move%s_product_price'%(m.id)] = m.purchase_line_id.price_unit - res['move%s_product_currency'%(m.id)] = pick.purchase_id.pricelist_id.currency_id.id + list_index = 0 + for item in res['product_moves_in']: + if item['move_id'] == m.id: + res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit + res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id + list_index += 1 return res stock_partial_picking() @@ -168,8 +172,12 @@ class stock_partial_move(osv.osv_memory): and m.purchase_line_id and m.picking_id.purchase_id: # We use the original PO unit purchase price as the basis for the cost, expressed # in the currency of the PO (i.e the PO's pricelist currency) - res['move%s_product_price'%(m.id)] = m.purchase_line_id.price_unit - res['move%s_product_currency'%(m.id)] = m.picking_id.purchase_id.pricelist_id.currency_id.id + list_index = 0 + for item in res['product_moves_in']: + if item['move_id'] == m.id: + res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit + res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id + list_index += 1 return res stock_partial_move() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: