[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.
This commit is contained in:
Humberto Arocha 2015-09-25 04:14:52 -04:30 committed by Josse Colpaert
parent 34ce3e36e1
commit 432d6585c9
1 changed files with 2 additions and 1 deletions

View File

@ -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: