Skip to content

Commit

Permalink
[FIX] a_s_import_base: sanitized acc number
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
remytms committed Oct 18, 2024
1 parent 3ac9f4c commit af52cb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion account_statement_import_base/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
}
Expand Down

0 comments on commit af52cb0

Please sign in to comment.