跳至內容
選單
此問題已被標幟
1 回覆
19440 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
4
7月 25
4444
0
12月 22
2171
2
3月 15
4739
2
7月 25
2096
1
3月 25
978