From 849a7ca1eed7be009a5548c6722c4f23f6a10c50 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Mon, 21 Oct 2024 15:09:50 +0200 Subject: [PATCH] [FIX] account_statement_import_online_paypal : search transaction with a 1 second margin to ensure it is found --- .../models/online_bank_statement_provider_paypal.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py b/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py index 2f515b04..bfcda564 100644 --- a/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py +++ b/account_statement_import_online_paypal/models/online_bank_statement_provider_paypal.py @@ -364,14 +364,15 @@ class OnlineBankStatementProviderPayPal(models.Model): def _paypal_get_transaction(self, token, transaction_id, timestamp): self.ensure_one() - transaction_date = timestamp.isoformat() + "Z" + transaction_date_ini = (timestamp - relativedelta(seconds=1)).isoformat() + "Z" + transaction_date_end = (timestamp + relativedelta(seconds=1)).isoformat() + "Z" url = ( (self.api_base or PAYPAL_API_BASE) + "/v1/reporting/transactions" + ("?start_date=%s" "&end_date=%s" "&fields=all") % ( - transaction_date, - transaction_date, + transaction_date_ini, + transaction_date_end, ) ) data = self._paypal_retrieve(url, token)