Split MT940 account into IBAN and currency for Rabobank

Closes #12882
This commit is contained in:
Cédric Krier
2024-01-01 14:20:29 +01:00
parent efa2b0efa7
commit 524f6abec9
+8 -1
View File
@@ -55,8 +55,10 @@ class StatementImport(metaclass=PoolMeta):
statement = Statement()
statement.name = mt940_statement.information
statement.company = self.start.company
account, currency = (
self.mt940_statement_account_currency(mt940_statement))
statement.journal = Journal.get_by_bank_account(
statement.company, mt940_statement.account)
statement.company, account)
if not statement.journal:
raise ImportStatementError(
gettext('account_statement.msg_import_no_journal',
@@ -83,6 +85,11 @@ class StatementImport(metaclass=PoolMeta):
statement.number_of_lines = len(mt940_statement.transactions)
return statement
def mt940_statement_account_currency(self, mt940_statement):
if self.start.mt940_bank == 'rabo':
return mt940_statement.account.split(' ', 1)
return mt940_statement.account, None
def mt940_origin(self, mt940_statement, transaction):
pool = Pool()
Origin = pool.get('account.statement.origin')