Skip to content

Commit

Permalink
preluare mesaje SPV
Browse files Browse the repository at this point in the history
  • Loading branch information
dhongu committed Dec 16, 2024
1 parent 45d2ee8 commit 92ac2d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion l10n_ro_message_spv/models/ciusro_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def _request_ciusro_download_zip(self, company, key_download, session):
method="GET",
params={"id": key_download},
)
if "error" in result:
if result.get("error", False):
return result

# E-Factura gives download response in ZIP format
Expand Down
16 changes: 3 additions & 13 deletions l10n_ro_message_spv/models/message_spv.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,9 @@ def download_from_spv(self):
key_download=message.name,
session=session,
)
status_code = response.get("status_code", 200)
# response, status_code = anaf_config._l10n_ro_einvoice_call(
# "/descarcare", params, method="GET"
# )
error = ""
if isinstance(response, dict):
error = response.get("eroare", "")
if status_code == "400":
error = response.get("message")
elif status_code == 200 and isinstance(response, dict):
error = response.get("eroare")
if not error:
error = message.check_anaf_error_xml(response["content"])

error = response.get("error", "")

if error:
message.write({"error": error})
continue
Expand Down

0 comments on commit 92ac2d1

Please sign in to comment.