Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
19652 มุมมอง

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
4775
0
ธ.ค. 22
2318
2
มี.ค. 15
4853
2
ก.ค. 25
2235
1
มี.ค. 25
1120