Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
6535 Prikazi

I designed the qweb report in Odoo 10. 

I need to give 2 images in the qweb report layout. So i wrote new layout for this module.

Layout.xml:

<template id="gl_layout_header">

    <div class="header">

        <div class="row">

            <div class="col-xs-offset-1 col-xs-7">

                <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 120px;"/>

            </div>

            <div class="col-xs-28">

            <img class="img img-responsive" src="/module/static/src/img/image2.png" style="max-height: 120px;"/>

            </div>

        </div>

    </div>

</template>


I give 2 images in the qweb header report. But it shows only one company logo in the report header. So how to give 2 images in the layout header qweb report.

Avatar
Opusti
Best Answer

I assume the second img tag is not showing. I believe it could be because of using the src attribute instead of t-att-src

Here's what I have at the top of one of my qweb reports to make both images show. You should also be able to do the thing that you did with your company.logo if the images are stored in the database as base64.

<img t-att-src="'/module/static/src/img/img1.png'" />
<img t-att-src="'/module/static/src/img/img2.png'" />
Avatar
Opusti
Avtor

Hi Devid,

Thanks. It works correctly.