Search code examples
pythonodoo

Odoo : Generate HTML file inside tmp folder


How to generate and store HTML file inside tmp folder When print the report in Print menu in ODOO11C ?


Solution

  • You can take a look at the web main controller

    report = request.env['ir.actions.report']._get_report_from_name(reportname)
    context = dict(request.env.context)
    html = report.with_context(context).render_qweb_html(docids, data=data)[0]