[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
parent 1b81b9d2f2
commit 8bb3fb5019

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,