コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
19642 ビュー

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
4753
0
12月 22
2311
2
3月 15
4847
2
7月 25
2232
1
3月 25
1112