Browse Source
[FIX] *_online_ponto: Correct retrieval of sync_id
12.0
Ronald Portier (Therp BV)
2 years ago
No known key found for this signature in database
GPG Key ID: A181F8124D7101D3
1 changed files with
4 additions and
2 deletions
-
account_bank_statement_import_online_ponto/models/ponto_interface.py
|
@ -110,10 +110,12 @@ class PontoInterface(models.AbstractModel): |
|
|
) |
|
|
) |
|
|
return |
|
|
return |
|
|
data = self._get_response_data(response) |
|
|
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: |
|
|
if not sync_id: |
|
|
raise UserError( |
|
|
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. |
|
|
# Poll synchronization during 400 seconds for completion. |
|
|
url = PONTO_ENDPOINT + "/synchronizations/" + sync_id |
|
|
url = PONTO_ENDPOINT + "/synchronizations/" + sync_id |
|
|