Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
6244 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

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'" />
Аватар
Відмінити
Автор

Hi Devid,

Thanks. It works correctly.