跳至内容
菜单
此问题已终结
1 回复
19504 查看

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
4526
0
12月 22
2215
2
3月 15
4766
2
7月 25
2150
1
3月 25
1032