Skip to content

Commit

Permalink
[14.0][FIX] Fixed field does not match alpha numeric criteria issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
murtuzasaleh committed Aug 16, 2022
1 parent 95a62c2 commit ccc31ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions account_banking_ach_base/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from odoo import _, fields, models
from odoo.exceptions import UserError

import re

CREDIT_AUTOMATED_RETURN = "21"
CREDIT_AUTOMATED_DEPOSIT = "22"
CREDIT_PRENOTE_DNE_ENR = "23"
Expand Down Expand Up @@ -145,14 +147,17 @@ def generate_ach_file(self):
self.validate_banking(line)
amount = line.amount_currency

name = re.sub('[^A-Za-z0-9]+', '', line.partner_id.name)
note = re.sub('[^A-Za-z0-9]+', '', line.communication)

entries.append(
{
"type": self.get_transaction_type(amount=amount),
"routing_number": line.partner_bank_id.bank_id.routing_number,
"account_number": line.partner_bank_id.acc_number,
"amount": str(amount),
"name": line.partner_id.name,
"addenda": [{"payment_related_info": line.communication}],
"name": name,
"addenda": [{"payment_related_info": note}],
}
)
outbound_payment = self.payment_type == "outbound"
Expand Down

0 comments on commit ccc31ac

Please sign in to comment.