Hello,
the goal is to generate a pdf with complex raw html data:
Model has a simple not-sanitized html field
That field might be edited by user through the Odoo website editor. In such a way its content might be complex and might have bootstrap classes such as 'col-lg-6', etc.
The pdf is generated using QWeb templates.
As a result, when printed not full content of containers is reflected in pdf. In particular, some columns are outside the page (not visible). For example, if to add the snippet '3 columns' or 'image + text column', only the first column is printed.
The question is what is a safe method to reflect the most content of html field in QWeb template.
Already tried:
t-esc, t-raw, t-field
wrapping in containers and in different html tags
provide css styles, including assigning different 'display' param
t-set full_width, even landscape page format
Please find a sample of source code below.
Field declaration
description =fields.Html(string="Description", sanitize=False)
Reports
<template id="report_item_document"> <t t-call="web.external_layout"> <div class="page"> <div class="oe_structure"/> <h2><span t-field="doc.name"/></h2> <div> <t t-raw="doc.description"/> </div> <div class="oe_structure"/> </div> </t> </template> <template id="report_item"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="doc"> <t t-call="my_module.report_item_document"/> </t> </t> </template>
Odoo Customization Tips: https://learnopenerp.tumblr.com/
Hi, Sehrish. I do not need to learn Odoo, I do need to print pdf with website edited html. Search by 'qweb' returns only very standard questions which are of no use for me