From ccc31ace3f7fa391af94fc4c92742f8bf1bfac09 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 | 9 +++++++-- 1 file changed, 7 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..e5f6be7b 100644 --- a/account_banking_ach_base/models/account_payment_order.py +++ b/account_banking_ach_base/models/account_payment_order.py @@ -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" @@ -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"