commit
dbfe1b0831
|
@ -6,7 +6,7 @@
|
||||||
"author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/reporting-engine",
|
"website": "https://github.com/OCA/reporting-engine",
|
||||||
"category": "Reporting",
|
"category": "Reporting",
|
||||||
"version": "15.0.1.0.1",
|
"version": "15.0.1.0.2",
|
||||||
"development_status": "Production/Stable",
|
"development_status": "Production/Stable",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"external_dependencies": {"python": ["xlsxwriter", "xlrd"]},
|
"external_dependencies": {"python": ["xlsxwriter", "xlrd"]},
|
||||||
|
|
|
@ -24,16 +24,16 @@ _logger = logging.getLogger(__name__)
|
||||||
class ReportController(report.ReportController):
|
class ReportController(report.ReportController):
|
||||||
@route()
|
@route()
|
||||||
def report_routes(self, reportname, docids=None, converter=None, **data):
|
def report_routes(self, reportname, docids=None, converter=None, **data):
|
||||||
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
|
|
||||||
context = dict(request.env.context)
|
|
||||||
if docids:
|
|
||||||
docids = [int(i) for i in docids.split(",")]
|
|
||||||
if data.get("options"):
|
|
||||||
data.update(json.loads(data.pop("options")))
|
|
||||||
if data.get("context"):
|
|
||||||
data["context"] = json.loads(data["context"])
|
|
||||||
context.update(data["context"])
|
|
||||||
if converter == "xlsx":
|
if converter == "xlsx":
|
||||||
|
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
|
||||||
|
context = dict(request.env.context)
|
||||||
|
if docids:
|
||||||
|
docids = [int(i) for i in docids.split(",")]
|
||||||
|
if data.get("options"):
|
||||||
|
data.update(json.loads(data.pop("options")))
|
||||||
|
if data.get("context"):
|
||||||
|
data["context"] = json.loads(data["context"])
|
||||||
|
context.update(data["context"])
|
||||||
xlsx = report.with_context(**context)._render_xlsx(docids, data=data)[0]
|
xlsx = report.with_context(**context)._render_xlsx(docids, data=data)[0]
|
||||||
xlsxhttpheaders = [
|
xlsxhttpheaders = [
|
||||||
(
|
(
|
||||||
|
|
|
@ -48,6 +48,7 @@ registry
|
||||||
} else if (onClose) {
|
} else if (onClose) {
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(false);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue