From 8bb3fb5019ccc4abc7f1659e5965e54f7dad35a5 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 19 Dec 2023 20:14:16 +0100 Subject: [PATCH] [FIX] account_statement_import_online_gocardless: Unique ID fallback Not all banks provide an entry reference or transaction ID, so we need to fallback to the Gocardless internal ID for getting the unique ID in such cases. TT46640 --- .../models/online_bank_statement_provider.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/account_statement_import_online_gocardless/models/online_bank_statement_provider.py b/account_statement_import_online_gocardless/models/online_bank_statement_provider.py index c33addf7..1b8ef2b5 100644 --- a/account_statement_import_online_gocardless/models/online_bank_statement_provider.py +++ b/account_statement_import_online_gocardless/models/online_bank_statement_provider.py @@ -312,8 +312,11 @@ class OnlineBankStatementProvider(models.Model): "payment_ref": tr.get( "remittanceInformationUnstructured", partner_name ), - "unique_import_id": tr.get("entryReference", False) - or tr.get("transactionId", False), + "unique_import_id": ( + tr.get("entryReference") + or tr.get("transactionId") + or tr.get("internalTransactionId") + ), "amount": amount_currency, "account_number": account_number, "partner_name": partner_name,