From 941ad7417904c9c7961037323980fafae8a9835f Mon Sep 17 00:00:00 2001 From: Murtuza Saleh Date: Tue, 16 Aug 2022 17:28:54 +0530 Subject: [PATCH] [14.0][FIX] Fixed field does not match alpha numeric criteria issue. --- account_banking_ach_base/models/account_payment_order.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/account_banking_ach_base/models/account_payment_order.py b/account_banking_ach_base/models/account_payment_order.py index 8244a56b..889b91ec 100644 --- a/account_banking_ach_base/models/account_payment_order.py +++ b/account_banking_ach_base/models/account_payment_order.py @@ -1,3 +1,4 @@ +import re from string import ascii_uppercase from ach.builder import AchFile @@ -145,14 +146,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"