Skip to Content
Menú
This question has been flagged
1 Respondre
18882 Vistes

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

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Descartar
Related Posts Respostes Vistes Activitat
5
de març 25
3684
0
de des. 22
1885
2
de març 15
4555
1
de març 25
620
1
d’oct. 24
1379