[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
This commit is contained in:
Pedro M. Baeza
2023-12-19 20:14:16 +01:00
committed by Nicolas JEUDY
parent b68f9d54e2
commit 1c06355727

View File

@@ -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,