Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
18965 Widoki

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


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Import this in the file,

from odoo import _

Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
Validation Error Rozwiązane
5
mar 25
3781
0
gru 22
1941
2
mar 15
4588
1
mar 25
678
1
paź 24
1449