From 85fd9721494311fc07c5856fe368d81345ce65cf Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 19 Apr 2016 18:20:57 +0200 Subject: [PATCH] [FIX] stock_landed_costs: use correct UoM Use the normalized quantity, otherwise the amount per unit is wrongly calculated. --- addons/stock_landed_costs/stock_landed_costs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 38aee976d15..85aff2b21ac 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -70,7 +70,7 @@ class stock_landed_cost(osv.osv): volume = move.product_id and move.product_id.volume * move.product_qty for quant in move.quant_ids: total_cost += quant.cost * quant.qty - vals = dict(product_id=move.product_id.id, move_id=move.id, quantity=move.product_uom_qty, former_cost=total_cost, weight=weight, volume=volume) + vals = dict(product_id=move.product_id.id, move_id=move.id, quantity=move.product_qty, former_cost=total_cost, weight=weight, volume=volume) lines.append(vals) if not lines: raise osv.except_osv(_('Error!'), _('The selected picking does not contain any move that would be impacted by landed costs. Landed costs are only possible for products configured in real time valuation with real price costing method. Please make sure it is the case, or you selected the correct picking'))