Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
19685 Представления

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


Аватар
Отменить
Лучший ответ

Hi,

Import this in the file,

from odoo import _

Thanks

Аватар
Отменить
Related Posts Ответы Просмотры Активность
Validation Error Решено
4
июл. 25
4817
0
дек. 22
2331
2
мар. 15
4861
2
июл. 25
2259
1
мар. 25
1138