Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
19658 Prikazi

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
Opusti
Best Answer

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
4
jul. 25
4780
0
dec. 22
2322
2
mar. 15
4854
2
jul. 25
2237
1
mar. 25
1121