diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 618df110e29..a7f2b4b4586 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -202,13 +202,13 @@ class stock_landed_cost(osv.osv): if not cost.valuation_adjustment_lines or not self._check_sum(cr, uid, cost, context=context): raise osv.except_osv(_('Error!'), _('You cannot validate a landed cost which has no valid valuation lines.')) move_id = self._create_account_move(cr, uid, cost, context=context) - quant_dict = {} for line in cost.valuation_adjustment_lines: if not line.move_id: continue per_unit = line.final_cost / line.quantity diff = per_unit - line.former_cost_per_unit quants = [quant for quant in line.move_id.quant_ids] + quant_dict = {} for quant in quants: if quant.id not in quant_dict: quant_dict[quant.id] = quant.cost + diff