From d4dfcd574060b6c3fa2332aad036570f47f2dfd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Taymans?= Date: Fri, 18 Oct 2024 14:01:45 +0200 Subject: [PATCH] [FIX] account_statement_import_base: sanitized acc number The field acc_number in the database is not sanitized by default. This leads to account_bank_statement_line with an empty partner_id because the check done in _statement_line_import_update_hook() uses the sanitized_acc_number instead of the acc_number. For a right comparison the sanitized version of the acc_number should be put in the speeddict. --- account_statement_import_base/models/account_journal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_statement_import_base/models/account_journal.py b/account_statement_import_base/models/account_journal.py index 3080fe74b..788054336 100644 --- a/account_statement_import_base/models/account_journal.py +++ b/account_statement_import_base/models/account_journal.py @@ -24,7 +24,10 @@ def _statement_line_import_speeddict(self): ["acc_number", "partner_id"], ) for partner_bank in partner_banks: - speeddict["account_number"][partner_bank["acc_number"]] = { + sanitized_acc_number = self._sanitize_bank_account_number( + partner_bank["acc_number"] + ) + speeddict["account_number"][sanitized_acc_number] = { "partner_id": partner_bank["partner_id"][0], "partner_bank_id": partner_bank["id"], }