Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
19704 Zobrazení

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


Avatar
Zrušit
Nejlepší odpověď

Hi,

Import this in the file,

from odoo import _

Thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
čvc 25
4843
0
pro 22
2339
2
bře 15
4870
2
čvc 25
2270
1
bře 25
1161