Odoo 10 QWeb report

Issue

I want to insert a logo in the header of a report using Odoo 10.

I tested

<img t-att-src = "'/ lt_sales / static / src / img / logo.png'" />

and

<img class = "img" src = "/ lt_sales / static / src / img / logo.png" />

It’s working In Odoo 8 without any problem, but not in Odoo 10. Why is that, and how can I fix it?

Solution

If you want using company logo:

<div class="col-xs-6 text-right">
    <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 50px;" />
</div>

If you want insert static image the report you need to have the image in the folder:

<div class="col-xs-6 text-right">
    <img class="img-responsive" src="/lt_sales/static/src/img/logo.png" style="max-height: 50px;" />
</div>

Answered By – Sankar guru

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published