Merge branch 'master-sale-account-discount' into 'master'
[IMP] Check condition if gross amount exists See merge request flectra-hq/flectra!24
This commit is contained in:
commit
09dd9328d8
@ -121,7 +121,7 @@ class AccountInvoice(models.Model):
|
|||||||
if self.discount < 0:
|
if self.discount < 0:
|
||||||
raise Warning(_("Discount should be less than Gross Amount"))
|
raise Warning(_("Discount should be less than Gross Amount"))
|
||||||
discount = self.discount or self.discount_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 "
|
raise Warning(_("Discount (%s) should be less than "
|
||||||
"Gross Amount (%s).") % (
|
"Gross Amount (%s).") % (
|
||||||
formatLang(self.env, discount, digits=2),
|
formatLang(self.env, discount, digits=2),
|
||||||
|
Loading…
Reference in New Issue
Block a user