I use odoo 11 latest version in windows.
My custom qweb template generate a good html, but the pdf does'nt work.
Default pdf reports work.
My code:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="sale.sale_proposition">
<t t-set="o" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<div class="page">
<div class="oe_structure"/>
<div style="text-align:center;font-size:1.5em;font-weight:bold;font-style:italic">
<div class="row">
Proposition technique et commerciale<br />
N° <span t-field="o.name" /><br />
POUR
</div>
<div>
<img t-if="o.partner_id.image" t-att-src="'data:image/png;base64,%s' % o.partner_id.image.decode('ascii')" style="max-height: 100px;"/>
</div>
<div>
<span t-field="o.partner_id.name" /><br />
<t t-if="o.partner_id.street"><span t-field="o.partner_id.street" /><br /></t>
<t t-if="o.partner_id.street2"><span t-field="o.partner_id.street2" /><br /></t>
<span t-if="o.partner_id.zip" t-field="o.partner_id.zip" />
<span t-if="o.partner_id.city" t-field="o.partner_id.city" /><br t-if="o.partner_id.city or o.partner_id.city" />
</div>
<div t-if="o.partner_id.privilegedContactId">
À l'attention de
<span t-if="o.partner_id.privilegedContactId.title" t-field="o.partner_id.privilegedContactId.title" />
<span t-field="o.partner_id.privilegedContactId.name" />
</div>
<div>
Réalisée par
</div>
<div>
<img class="img img-responsive" src="/mymodule/static/img/coverpage.jpg"/>
</div>
</div>
<div class="oe_structure"/>
</div>
</template>
<template id="sale.report_proposition">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="sale.sale_proposition" t-lang="doc.partner_id.lang"/>
</t>
</t>
</template>
<report
id="sale.action_report_proposition"
string="Proposition commerciale"
model="sale.order"
report_type="qweb-pdf"
file="sale.report_proposition"
name="sale.report_proposition"
print_report_name="'Proposition_commerciale_%s' % (object.name)"
/>
</odoo>
Here's what I get by opening the pdf with my text editor:
Hello Benoît Fontaine,
Can you please check the version of wkhtmltopdf library which installed & responsible for the same.
Stable version of wkhtmltopdf is > wkhtmltopdf 0.12.2.1 (with patched qt).
Thanks