Skip to Content
Menu
This question has been flagged
1 Reply
16960 Views

Hi,

The above prompt error is from the ff code:



from odoo.exceptions import UserError, ValidationError

class AccountPayment(models.Model):
    _inherit = "account.payment"

    # readonly=True,
    check_number_char = fields.Char(string="Check Number")

    @api.one
    @api.constrains('check_number_char')
    def isNumeric_check_number(self):

        if not self.check_number_char.isdigit():
             raise ValidationError(_("A check number must be numeric."))


Avatar
Discard
Best Answer

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Discard
Related Posts Replies Views Activity
5
Jun 24
1567
0
Dec 22
1344
2
Mar 15
3966
1
Oct 24
342
3
May 24
2875