[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:
DJ Patel 2014-04-11 10:24:37 +05:30
parent fb18693a4d
commit 5e04721db4
1 changed files with 3 additions and 1 deletions

View File

@ -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}