From 54686b47aae362d171f7f7ec1aa02e26df2c2e73 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 27 May 2009 12:52:12 +0530 Subject: [PATCH] [FIX] Bug 379461 : float division error corrected bzr revid: jvo@tinyerp.com-20090527072212-ix3tkf1xbu9rg3q1 --- addons/sale/sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index eabfc06b9fe..1521896b495 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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