From 5e04721db48d0e75ba3c3ea614e26868832390c5 Mon Sep 17 00:00:00 2001 From: DJ Patel Date: Fri, 11 Apr 2014 10:24:37 +0530 Subject: [PATCH] [ADD] stock_landed_costs : Added the mechanism to automatically fill the weight and volume on picking onchange. bzr revid: mdi@tinyerp.com-20140411045437-p6fhz1tgpp9893lh --- addons/stock_landed_costs/stock_landed_costs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 72cba12efa4..11a99542eab 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -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}