Skip to content

Commit

Permalink
[MIG] l10n_us_account_routing: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Oct 3, 2023
1 parent bcbf3f1 commit 76a8fa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion l10n_us_account_routing/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Bank Routing Numbers",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Banking addons",
"summary": "Add the routing numbers to the banks",
"author": "ForgeFlow, Odoo Community Association (OCA)",
Expand Down
12 changes: 5 additions & 7 deletions l10n_us_account_routing/models/res_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ResBank(models.Model):
_inherit = "res.bank"

routing_number = fields.Char(string="Routing Number")
routing_number = fields.Char()

@api.constrains("routing_number")
def validate_routing_number(self):
Expand All @@ -19,13 +19,11 @@ def validate_routing_number(self):
rtn.validate(self.routing_number)
except Exception:
raise ValidationError(
_("%s is not a valid US routing number!" % self.routing_number)
)
_("%s is not a valid US routing number!") % self.routing_number
) from None
elif country_code == "CA":
if len(self.routing_number) != 8 or not self.routing_number.isdigit():
raise ValidationError(
_(
"%s is not a valid Canadian routing number!"
% self.routing_number
)
_("%s is not a valid Canadian routing number!")
% self.routing_number
)

0 comments on commit 76a8fa5

Please sign in to comment.