Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
19666 Переглядів

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
4793
0
груд. 22
2323
2
бер. 15
4854
2
лип. 25
2239
1
бер. 25
1127