Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
19631 Vizualizări

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."))


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Import this in the file,

from odoo import _

Thanks

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
iul. 25
4740
0
dec. 22
2305
2
mar. 15
4842
2
iul. 25
2224
1
mar. 25
1103