[FIX] Account : Validation should not throw sero division error

lp bug: https://launchpad.net/bugs/663402 fixed

bzr revid: jvo@tinyerp.com-20101020135803-m4wyc0uk32aulv6f
This commit is contained in:
JMA(OpenERP)
2010-10-20 19:28:03 +05:30
committed by Jay (OpenERP)
parent 1d537d4724
commit 396c02cf42
+1 -1
View File
@@ -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."))