From ef8fc58c3c69fec5e467621609b5f1af377ce740 Mon Sep 17 00:00:00 2001 From: Haresh Chavda Date: Fri, 9 Feb 2018 11:34:22 +0530 Subject: [PATCH] [IMP] Check condition if gross amount exists --- addons/account_discount/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_discount/models/account_invoice.py b/addons/account_discount/models/account_invoice.py index 3d269c77..58909769 100644 --- a/addons/account_discount/models/account_invoice.py +++ b/addons/account_discount/models/account_invoice.py @@ -121,7 +121,7 @@ class AccountInvoice(models.Model): if self.discount < 0: raise Warning(_("Discount should be less than Gross Amount")) discount = self.discount or self.discount_amount - if discount > self.gross_amount: + if self.gross_amount and discount > self.gross_amount: raise Warning(_("Discount (%s) should be less than " "Gross Amount (%s).") % ( formatLang(self.env, discount, digits=2),