Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
19183 Tampilan

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
Buang
Jawaban Terbai

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
Validation Error Diselesaikan
5
Mar 25
4083
0
Des 22
2037
2
Mar 15
4654
1
Mar 25
794
1
Okt 24
1579