My question is, just I need a quick response. I need to download a qweb report from odoo website. Now i can only make that as a pdf preview of browser. so what should I need to add on odoo controller ?
My controller code is,
@http.route(['/cms/report/print'], type='http', auth="public", website=True)
def print_docr(self, **kw):
cr, uid, context = request.cr, SUPERUSER_ID, request.context
if 2:
pdf = request.registry['report'].get_pdf(cr, uid, [2], 'x.cms_html_body', data=None,
context=context)
pdfhttpheaders = [('Content-Type', 'application/pdf'), ('Content-Length', len(pdf))]
return request.make_response(pdf, headers=pdfhttpheaders)