[ADD] stock_landed_costs : Added the mechanism to automatically fill the weight and volume on picking onchange.
bzr revid: mdi@tinyerp.com-20140411045437-p6fhz1tgpp9893lh
This commit is contained in:
parent
fb18693a4d
commit
5e04721db4
|
@ -62,10 +62,12 @@ class stock_landed_cost(osv.osv):
|
|||
for move in picking.move_lines:
|
||||
total_cost = 0.0
|
||||
total_qty = 0.0
|
||||
weight = move.product_id and move.product_id.weight
|
||||
volume = move.product_id and move.product_id.volume
|
||||
for quant in move.quant_ids:
|
||||
total_cost += quant.cost
|
||||
total_qty += quant.qty
|
||||
vals = dict(product_id = move.product_id.id, move_id = move.id, quantity = move.product_uom_qty, former_cost = total_cost * total_qty)
|
||||
vals = dict(product_id = move.product_id.id, move_id = move.id, quantity = move.product_uom_qty, former_cost = total_cost * total_qty, weight = weight, volume = volume)
|
||||
lines.append(vals)
|
||||
result['valuation_adjustment_lines'] = lines
|
||||
return {'value': result}
|
||||
|
|
Loading…
Reference in New Issue