From aa2ea62b23a0a354ab94008d32409bb8071f4e02 Mon Sep 17 00:00:00 2001 From: Naglis Jonaitis Date: Sun, 11 Mar 2018 15:35:43 +0200 Subject: [PATCH] [IMP] report_fillpdf, report_xlsx, report_xml: Use content_disposition helper --- report_fillpdf/__manifest__.py | 2 +- report_fillpdf/controllers/main.py | 4 ++-- report_xlsx/__manifest__.py | 2 +- report_xlsx/controllers/main.py | 4 ++-- report_xml/__manifest__.py | 2 +- report_xml/controllers/main.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/report_fillpdf/__manifest__.py b/report_fillpdf/__manifest__.py index 2ac1e87b..74d433d3 100644 --- a/report_fillpdf/__manifest__.py +++ b/report_fillpdf/__manifest__.py @@ -9,7 +9,7 @@ 'Odoo Community Association (OCA)', 'website': "http://github.com/oca/reporting-engine", 'category': 'Reporting', - 'version': '11.0.1.0.0', + 'version': '11.0.1.0.1', 'license': 'AGPL-3', 'external_dependencies': { 'python': [ diff --git a/report_fillpdf/controllers/main.py b/report_fillpdf/controllers/main.py index 1167911b..2b7a96fc 100644 --- a/report_fillpdf/controllers/main.py +++ b/report_fillpdf/controllers/main.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). from odoo.addons.web.controllers import main as report -from odoo.http import route, request +from odoo.http import content_disposition, route, request import json @@ -34,7 +34,7 @@ class ReportController(report.ReportController): ('Content-Length', len(pdf)), ( 'Content-Disposition', - 'attachment; filename=' + report.report_file + '.pdf' + content_disposition(report.report_file + '.pdf') ) ] return request.make_response(pdf, headers=pdfhttpheaders) diff --git a/report_xlsx/__manifest__.py b/report_xlsx/__manifest__.py index 6104c1ac..d0d92dc0 100644 --- a/report_xlsx/__manifest__.py +++ b/report_xlsx/__manifest__.py @@ -10,7 +10,7 @@ 'Odoo Community Association (OCA)', 'website': "http://github.com/oca/reporting-engine", 'category': 'Reporting', - 'version': '11.0.1.0.0', + 'version': '11.0.1.0.1', 'license': 'AGPL-3', 'external_dependencies': { 'python': [ diff --git a/report_xlsx/controllers/main.py b/report_xlsx/controllers/main.py index 3c8c6a4c..79cabdb9 100644 --- a/report_xlsx/controllers/main.py +++ b/report_xlsx/controllers/main.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). from odoo.addons.web.controllers import main as report -from odoo.http import route, request +from odoo.http import content_disposition, route, request import json @@ -35,7 +35,7 @@ class ReportController(report.ReportController): ('Content-Length', len(xlsx)), ( 'Content-Disposition', - 'attachment; filename=' + report.report_file + '.xlsx' + content_disposition(report.report_file + '.xlsx') ) ] return request.make_response(xlsx, headers=xlsxhttpheaders) diff --git a/report_xml/__manifest__.py b/report_xml/__manifest__.py index a8f1c2b3..8bce2601 100644 --- a/report_xml/__manifest__.py +++ b/report_xml/__manifest__.py @@ -4,7 +4,7 @@ { "name": "XML Reports", - "version": "11.0.1.0.0", + "version": "11.0.1.0.1", "category": "Reporting", "website": "https://github.com/OCA/reporting-engine", "author": "Grupo ESOC IngenierĂ­a de Servicios, " diff --git a/report_xml/controllers/main.py b/report_xml/controllers/main.py index 32fc55fc..8c35600e 100644 --- a/report_xml/controllers/main.py +++ b/report_xml/controllers/main.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). from odoo.addons.web.controllers import main as report -from odoo.http import route +from odoo.http import content_disposition, route class ReportController(report.ReportController): @@ -23,5 +23,5 @@ class ReportController(report.ReportController): response.headers.set('Content-length', len(response.data)) response.headers.set( 'Content-Disposition', - 'attachment; filename="'+reportname+".xml") + content_disposition(reportname + ".xml")) return response