[FIX] Bug 379461 : float division error corrected
bzr revid: jvo@tinyerp.com-20090527072212-ix3tkf1xbu9rg3q1
This commit is contained in:
parent
dd0c192a52
commit
54686b47aa
|
@ -127,8 +127,9 @@ class sale_order(osv.osv):
|
||||||
for invoice in sale.invoice_ids:
|
for invoice in sale.invoice_ids:
|
||||||
if invoice.state not in ('draft','cancel'):
|
if invoice.state not in ('draft','cancel'):
|
||||||
tot += invoice.amount_untaxed
|
tot += invoice.amount_untaxed
|
||||||
|
|
||||||
if tot:
|
if tot:
|
||||||
res[sale.id] = min(100.0, tot * 100.0 / sale.amount_untaxed)
|
res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
|
||||||
else:
|
else:
|
||||||
res[sale.id] = 0.0
|
res[sale.id] = 0.0
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue