Skip to content
Snippets Groups Projects
Commit 9a98d192 authored by Ricardo Gomes Rodrigues (rigr)'s avatar Ricardo Gomes Rodrigues (rigr)
Browse files

[FIX] account: fix bank statement import from BNP


Before this commit, importing an .OFX file from BNP failed because the account number format is not the same.

This is a problem on BNP's side but it is blocking for our clients and needs to be fixed.

This commit fixes this by checking that the account number corresponds to a specific part of the IBAN (for France only).

Task id 2860720

closes odoo/odoo#97413

Signed-off-by: default avatarFlorian Gilbert (flg) <flg@odoo.com>
parent afcad067
Branches
Tags
No related merge requests found
......@@ -136,7 +136,8 @@ class AccountBankStatementImport(models.TransientModel):
sanitized_acc_number = journal.bank_account_id.sanitized_acc_number
if " " in sanitized_acc_number:
sanitized_acc_number = sanitized_acc_number.split(" ")[0]
if len(sanitized_acc_number) == 27 and sanitized_acc_number[:2].upper() == "FR":
# Needed for BNP France
if len(sanitized_acc_number) == 27 and len(account_number) == 11 and sanitized_acc_number[:2].upper() == "FR":
return sanitized_acc_number[14:-2] == account_number
return sanitized_acc_number == account_number
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment