콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6246 화면

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.