mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[FIX] report_xlsx: initialize reportname
This commit is contained in:
committed by
Dario Del Zozzo
parent
173301c3c3
commit
c1d22fe213
@@ -52,8 +52,8 @@ class ReportController(ReportController):
|
||||
def report_download(self, data, context=None, token=None):
|
||||
requestcontent = json.loads(data)
|
||||
url, report_type = requestcontent[0], requestcontent[1]
|
||||
try:
|
||||
if report_type == "xlsx":
|
||||
if report_type == "xlsx":
|
||||
try:
|
||||
reportname = url.split("/report/xlsx/")[1].split("?")[0]
|
||||
docids = None
|
||||
if "/" in reportname:
|
||||
@@ -95,10 +95,10 @@ class ReportController(ReportController):
|
||||
"Content-Disposition", content_disposition(filename)
|
||||
)
|
||||
return response
|
||||
else:
|
||||
return super().report_download(data, context=context, token=token)
|
||||
except Exception as e:
|
||||
_logger.exception("Error while generating report %s", reportname)
|
||||
se = _serialize_exception(e)
|
||||
error = {"code": 200, "message": "Odoo Server Error", "data": se}
|
||||
return request.make_response(html_escape(json.dumps(error)))
|
||||
except Exception as e:
|
||||
_logger.exception("Error while generating report %s", reportname)
|
||||
se = _serialize_exception(e)
|
||||
error = {"code": 200, "message": "Odoo Server Error", "data": se}
|
||||
return request.make_response(html_escape(json.dumps(error)))
|
||||
else:
|
||||
return super().report_download(data, context=context, token=token)
|
||||
|
||||
Reference in New Issue
Block a user