From 432d6585c91a4c3fdaa72c4851c248f5a21945b6 Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Fri, 25 Sep 2015 04:14:52 -0430 Subject: [PATCH] [FIX] Landed Cost: When Creating Negative costs with more than one picking line fixes #8714 check_sum fails as whole cost from cost_lines field are fully allocated to first item in picking. --- addons/stock_landed_costs/stock_landed_costs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 1a879336e49..618df110e29 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -286,7 +286,8 @@ class stock_landed_cost(osv.osv): if digits: value = float_round(value, precision_digits=digits[1], rounding_method='UP') - value = min(value, line.price_unit - value_split) + fnc = min if line.price_unit > 0 else max + value = fnc(value, line.price_unit - value_split) value_split += value if valuation.id not in towrite_dict: