Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa2ea62

Browse files
committed
[IMP] report_fillpdf, report_xlsx, report_xml: Use content_disposition helper
1 parent fcf6217 commit aa2ea62

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

report_fillpdf/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
'Odoo Community Association (OCA)',
1010
'website': "http://github.com/oca/reporting-engine",
1111
'category': 'Reporting',
12-
'version': '11.0.1.0.0',
12+
'version': '11.0.1.0.1',
1313
'license': 'AGPL-3',
1414
'external_dependencies': {
1515
'python': [

report_fillpdf/controllers/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
33

44
from odoo.addons.web.controllers import main as report
5-
from odoo.http import route, request
5+
from odoo.http import content_disposition, route, request
66

77
import json
88

@@ -34,7 +34,7 @@ def report_routes(self, reportname, docids=None, converter=None, **data):
3434
('Content-Length', len(pdf)),
3535
(
3636
'Content-Disposition',
37-
'attachment; filename=' + report.report_file + '.pdf'
37+
content_disposition(report.report_file + '.pdf')
3838
)
3939
]
4040
return request.make_response(pdf, headers=pdfhttpheaders)

report_xlsx/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'Odoo Community Association (OCA)',
1111
'website': "http://github.com/oca/reporting-engine",
1212
'category': 'Reporting',
13-
'version': '11.0.1.0.0',
13+
'version': '11.0.1.0.1',
1414
'license': 'AGPL-3',
1515
'external_dependencies': {
1616
'python': [

report_xlsx/controllers/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
33

44
from odoo.addons.web.controllers import main as report
5-
from odoo.http import route, request
5+
from odoo.http import content_disposition, route, request
66

77
import json
88

@@ -35,7 +35,7 @@ def report_routes(self, reportname, docids=None, converter=None, **data):
3535
('Content-Length', len(xlsx)),
3636
(
3737
'Content-Disposition',
38-
'attachment; filename=' + report.report_file + '.xlsx'
38+
content_disposition(report.report_file + '.xlsx')
3939
)
4040
]
4141
return request.make_response(xlsx, headers=xlsxhttpheaders)

report_xml/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "XML Reports",
7-
"version": "11.0.1.0.0",
7+
"version": "11.0.1.0.1",
88
"category": "Reporting",
99
"website": "https://github.com/OCA/reporting-engine",
1010
"author": "Grupo ESOC Ingeniería de Servicios, "

report_xml/controllers/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
44

55
from odoo.addons.web.controllers import main as report
6-
from odoo.http import route
6+
from odoo.http import content_disposition, route
77

88

99
class ReportController(report.ReportController):
@@ -23,5 +23,5 @@ def report_routes(self, reportname, docids=None, converter=None, **data):
2323
response.headers.set('Content-length', len(response.data))
2424
response.headers.set(
2525
'Content-Disposition',
26-
'attachment; filename="'+reportname+".xml")
26+
content_disposition(reportname + ".xml"))
2727
return response

0 commit comments

Comments
 (0)