mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-26 13:12:03 +02:00
Initial commit: L10N_Americas packages
This commit is contained in:
commit
12b27ce151
714 changed files with 79328 additions and 0 deletions
4
odoo-bringout-oca-ocb-l10n_us/l10n_us/models/__init__.py
Normal file
4
odoo-bringout-oca-ocb-l10n_us/l10n_us/models/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import res_partner_bank
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import re
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class ResPartnerBank(models.Model):
|
||||
_inherit = 'res.partner.bank'
|
||||
|
||||
aba_routing = fields.Char(string="ABA/Routing", help="American Bankers Association Routing Number")
|
||||
|
||||
@api.constrains('aba_routing')
|
||||
def _check_aba_routing(self):
|
||||
for bank in self:
|
||||
if bank.aba_routing and not re.match(r'^\d{1,9}$', bank.aba_routing):
|
||||
raise ValidationError(_('ABA/Routing should only contains numbers (maximum 9 digits).'))
|
||||
Loading…
Add table
Add a link
Reference in a new issue