Browse Source
[IMP] report_fillpdf, report_xlsx, report_xml: Use content_disposition helper
pull/199/head
Naglis Jonaitis
7 years ago
No known key found for this signature in database
GPG Key ID: 54DA26AC89685C57
6 changed files with
9 additions and
9 deletions
-
report_fillpdf/__manifest__.py
-
report_fillpdf/controllers/main.py
-
report_xlsx/__manifest__.py
-
report_xlsx/controllers/main.py
-
report_xml/__manifest__.py
-
report_xml/controllers/main.py
|
@ -9,7 +9,7 @@ |
|
|
'Odoo Community Association (OCA)', |
|
|
'Odoo Community Association (OCA)', |
|
|
'website': "http://github.com/oca/reporting-engine", |
|
|
'website': "http://github.com/oca/reporting-engine", |
|
|
'category': 'Reporting', |
|
|
'category': 'Reporting', |
|
|
'version': '11.0.1.0.0', |
|
|
|
|
|
|
|
|
'version': '11.0.1.0.1', |
|
|
'license': 'AGPL-3', |
|
|
'license': 'AGPL-3', |
|
|
'external_dependencies': { |
|
|
'external_dependencies': { |
|
|
'python': [ |
|
|
'python': [ |
|
|
|
@ -2,7 +2,7 @@ |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
|
|
|
|
|
|
from odoo.addons.web.controllers import main as report |
|
|
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 |
|
|
import json |
|
|
|
|
|
|
|
@ -34,7 +34,7 @@ class ReportController(report.ReportController): |
|
|
('Content-Length', len(pdf)), |
|
|
('Content-Length', len(pdf)), |
|
|
( |
|
|
( |
|
|
'Content-Disposition', |
|
|
'Content-Disposition', |
|
|
'attachment; filename=' + report.report_file + '.pdf' |
|
|
|
|
|
|
|
|
content_disposition(report.report_file + '.pdf') |
|
|
) |
|
|
) |
|
|
] |
|
|
] |
|
|
return request.make_response(pdf, headers=pdfhttpheaders) |
|
|
return request.make_response(pdf, headers=pdfhttpheaders) |
|
|
|
@ -10,7 +10,7 @@ |
|
|
'Odoo Community Association (OCA)', |
|
|
'Odoo Community Association (OCA)', |
|
|
'website': "http://github.com/oca/reporting-engine", |
|
|
'website': "http://github.com/oca/reporting-engine", |
|
|
'category': 'Reporting', |
|
|
'category': 'Reporting', |
|
|
'version': '11.0.1.0.0', |
|
|
|
|
|
|
|
|
'version': '11.0.1.0.1', |
|
|
'license': 'AGPL-3', |
|
|
'license': 'AGPL-3', |
|
|
'external_dependencies': { |
|
|
'external_dependencies': { |
|
|
'python': [ |
|
|
'python': [ |
|
|
|
@ -2,7 +2,7 @@ |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
|
|
|
|
|
|
from odoo.addons.web.controllers import main as report |
|
|
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 |
|
|
import json |
|
|
|
|
|
|
|
@ -35,7 +35,7 @@ class ReportController(report.ReportController): |
|
|
('Content-Length', len(xlsx)), |
|
|
('Content-Length', len(xlsx)), |
|
|
( |
|
|
( |
|
|
'Content-Disposition', |
|
|
'Content-Disposition', |
|
|
'attachment; filename=' + report.report_file + '.xlsx' |
|
|
|
|
|
|
|
|
content_disposition(report.report_file + '.xlsx') |
|
|
) |
|
|
) |
|
|
] |
|
|
] |
|
|
return request.make_response(xlsx, headers=xlsxhttpheaders) |
|
|
return request.make_response(xlsx, headers=xlsxhttpheaders) |
|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
"name": "XML Reports", |
|
|
"name": "XML Reports", |
|
|
"version": "11.0.1.0.0", |
|
|
|
|
|
|
|
|
"version": "11.0.1.0.1", |
|
|
"category": "Reporting", |
|
|
"category": "Reporting", |
|
|
"website": "https://github.com/OCA/reporting-engine", |
|
|
"website": "https://github.com/OCA/reporting-engine", |
|
|
"author": "Grupo ESOC Ingeniería de Servicios, " |
|
|
"author": "Grupo ESOC Ingeniería de Servicios, " |
|
|
|
@ -3,7 +3,7 @@ |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html). |
|
|
|
|
|
|
|
|
from odoo.addons.web.controllers import main as report |
|
|
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): |
|
|
class ReportController(report.ReportController): |
|
@ -23,5 +23,5 @@ class ReportController(report.ReportController): |
|
|
response.headers.set('Content-length', len(response.data)) |
|
|
response.headers.set('Content-length', len(response.data)) |
|
|
response.headers.set( |
|
|
response.headers.set( |
|
|
'Content-Disposition', |
|
|
'Content-Disposition', |
|
|
'attachment; filename="'+reportname+".xml") |
|
|
|
|
|
|
|
|
content_disposition(reportname + ".xml")) |
|
|
return response |
|
|
return response |