From db971c4a3c633a771893b966c43f74c616d29826 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 11 May 2022 19:27:48 +0200 Subject: [PATCH] [FIX] report_download controller method signature in two modules --- report_py3o/controllers/main.py | 6 ++++-- report_qweb_encrypt/controllers/main.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/report_py3o/controllers/main.py b/report_py3o/controllers/main.py index c26fee9fb..fcc81b5d1 100644 --- a/report_py3o/controllers/main.py +++ b/report_py3o/controllers/main.py @@ -57,7 +57,7 @@ class ReportController(main.ReportController): return request.make_response(res, headers=http_headers) @route() - def report_download(self, data, token): + def report_download(self, data, token, context=None): """This function is used by 'qwebactionmanager.js' in order to trigger the download of a py3o/controller report. @@ -68,7 +68,9 @@ class ReportController(main.ReportController): requestcontent = json.loads(data) url, report_type = requestcontent[0], requestcontent[1] if "py3o" not in report_type: - return super(ReportController, self).report_download(data, token) + return super(ReportController, self).report_download( + data, token, context=context + ) try: reportname = url.split("/report/py3o/")[1].split("?")[0] docids = None diff --git a/report_qweb_encrypt/controllers/main.py b/report_qweb_encrypt/controllers/main.py index 015468354..ed8526f18 100644 --- a/report_qweb_encrypt/controllers/main.py +++ b/report_qweb_encrypt/controllers/main.py @@ -12,8 +12,8 @@ from odoo.addons.web.controllers import main as report class ReportController(report.ReportController): @route() - def report_download(self, data, token): - result = super().report_download(data, token) + def report_download(self, data, token, context=None): + result = super().report_download(data, token, context=context) # When report is downloaded from print action, this function is called, # but this function cannot pass context (manually entered password) to # report.render_qweb_pdf(), encrypton for manual password is done here.