跳至内容
菜单
此问题已终结
1 回复
6242 查看

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.