[FIX] Bug 379461 : float division error corrected

bzr revid: jvo@tinyerp.com-20090527072212-ix3tkf1xbu9rg3q1
This commit is contained in:
Jay (Open ERP) 2009-05-27 12:52:12 +05:30
parent dd0c192a52
commit 54686b47aa
1 changed files with 2 additions and 1 deletions

View File

@ -127,8 +127,9 @@ class sale_order(osv.osv):
for invoice in sale.invoice_ids:
if invoice.state not in ('draft','cancel'):
tot += invoice.amount_untaxed
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:
res[sale.id] = 0.0
return res