From 6cce2257f5dc99b8d8fc2534061fa9cffb2b03dd Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Thu, 15 Sep 2022 09:57:52 +0200 Subject: [PATCH] [FIX] *_online_ponto: Correct retrieval of sync_id --- .../models/ponto_interface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_bank_statement_import_online_ponto/models/ponto_interface.py b/account_bank_statement_import_online_ponto/models/ponto_interface.py index d9f0c70..7a1df28 100644 --- a/account_bank_statement_import_online_ponto/models/ponto_interface.py +++ b/account_bank_statement_import_online_ponto/models/ponto_interface.py @@ -110,10 +110,12 @@ class PontoInterface(models.AbstractModel): ) return data = self._get_response_data(response) - sync_id = data.get("attributes", {}).get("resourceId", False) + # The resourceId in data["attributes"] is the account, + # we need the synchronization. + sync_id = data.get("data", {}).get("id", False) if not sync_id: raise UserError( - _("Ponto : no resourceId in synchronization data %s") % data + _("Ponto : no synchronization id in data %s") % data ) # Poll synchronization during 400 seconds for completion. url = PONTO_ENDPOINT + "/synchronizations/" + sync_id