Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
19649 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Import this in the file,

from odoo import _

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
Validation Error Đã xử lý
4
thg 7 25
4766
0
thg 12 22
2314
2
thg 3 15
4850
2
thg 7 25
2233
1
thg 3 25
1116