[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
This commit is contained in:
qdp-launchpad@tinyerp.com
2011-01-19 02:17:24 +01:00
parent 0604e48888
commit 2fbecc4238
+12 -4
View File
@@ -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: