From 4751a49a9fb6fc7cd5acc5690aa6ee882812e800 Mon Sep 17 00:00:00 2001 From: DJ Patel Date: Mon, 21 Apr 2014 15:17:48 +0530 Subject: [PATCH] [FIX] stock_landed_costs : Fixed the calculation of former cost per unit. bzr revid: mdi@tinyerp.com-20140421094748-eg9l1yfjwr57ekz6 --- 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 2efcfc160c7..94086c120f1 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -268,7 +268,7 @@ class stock_valuation_adjustment_lines(osv.osv): 'former_cost_per_unit': 0.0, 'final_cost': 0.0, } - result[line.id]['former_cost_per_unit'] = (line.former_cost / line.quantity or 1.0) + result[line.id]['former_cost_per_unit'] = (line.former_cost / line.quantity if line.quantity else 1.0) result[line.id]['final_cost'] = (line.former_cost + line.additional_landed_cost) return result