From 396c02cf429f49e16fb7ce87aa3b3f70f5ba824b Mon Sep 17 00:00:00 2001 From: "JMA(OpenERP)" <> Date: Wed, 20 Oct 2010 19:28:03 +0530 Subject: [PATCH] [FIX] Account : Validation should not throw sero division error lp bug: https://launchpad.net/bugs/663402 fixed bzr revid: jvo@tinyerp.com-20101020135803-m4wyc0uk32aulv6f --- addons/account/invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index ab9b90d7361..dbac0fdd745 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -830,7 +830,7 @@ class account_invoice(osv.osv): total_fixed += line.value_amount if line.value == 'procent': total_percent += line.value_amount - total_fixed = (total_fixed * 100) / inv.amount_total + total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0) if (total_fixed + total_percent) > 100: raise osv.except_osv(_('Error !'), _("Cannot create the invoice !\nThe payment term defined gives a computed amount greater than the total invoiced amount."))