From 7aaab812932835d62e2b5a5d7e964a2333b313be Mon Sep 17 00:00:00 2001 From: BT-cjimeno Date: Tue, 29 Aug 2023 08:39:38 +0200 Subject: [PATCH] [FIX][MOD] Fix error and adapt code to find some specific journals --- account_ebics/models/ebics_file.py | 6 ++++++ .../wizards/account_statement_import.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/account_ebics/models/ebics_file.py b/account_ebics/models/ebics_file.py index 7ef3514..eae82b5 100644 --- a/account_ebics/models/ebics_file.py +++ b/account_ebics/models/ebics_file.py @@ -179,6 +179,12 @@ class EbicsFile(models.Model): return True def _lookup_journal(self, res, acc_number, currency_code): + + # Some bank accounts contain the currency code at the end, and this causes problems when searching for + # journals with that bank account number + if acc_number and currency_code and acc_number[-3:] == currency_code.upper(): + acc_number = acc_number[:-3] + currency = self.env["res.currency"].search( [("name", "=ilike", currency_code)], limit=1 ) diff --git a/account_ebics_oca_statement_import/wizards/account_statement_import.py b/account_ebics_oca_statement_import/wizards/account_statement_import.py index 09dcded..3f1519d 100644 --- a/account_ebics_oca_statement_import/wizards/account_statement_import.py +++ b/account_ebics_oca_statement_import/wizards/account_statement_import.py @@ -62,7 +62,7 @@ class AccountStatementImport(models.TransientModel): "Statement %(st_name)s dated %(date)s " "has already been imported.", st_name=st_vals["name"], - date=st_vals["date"].strftime("%Y-%m-%d"), + date=st_vals["date"], ) )