This question has been flagged

Hello,


need when validate customer invoice i want to check the product quantity on invoice line if the quantity more than the quantity on hand create a warning that the quantity in the invoice line more than quantity on hand .


Thanks.


Avatar
Discard

what is the validation ?


Best Answer

Hi ,

To achieve this you can super the function of the validate button and can add the validations.

class AccountInvoiceInherit(models.Model):
_inherit = 'account.invoice'

@api.multi
def action_invoice_open(self, vals):
# check here and add the validations
res = super(AccountInvoiceInherit, self).action_invoice_open(vals)
return res
Avatar
Discard