Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
19633 Vues

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
Ignorer
Meilleure réponse

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Ignorer
Publications associées Réponses Vues Activité
4
juil. 25
4742
0
déc. 22
2306
2
mars 15
4843
2
juil. 25
2224
1
mars 25
1103