Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
19191 Vistas

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
Mejor respuesta

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
5
mar 25
4095
0
dic 22
2039
2
mar 15
4657
1
mar 25
794
1
oct 24
1585