[FIX][MOD] Fix error and adapt code to find some specific journals

This commit is contained in:
BT-cjimeno 2023-08-29 08:39:38 +02:00
parent 4a2b7b44ab
commit 7aaab81293
2 changed files with 7 additions and 1 deletions

View File

@ -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
)

View File

@ -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"],
)
)