Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
22526 มุมมอง

please help me , 

I am working on qweb report but i need to get name of my company to show the proper header and footer please help me this urgent issue 

thank you so much

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I your xml, call the template for getting the company name by using the following method:

        <template id="report_session">
            <t t-call="report.html_container">
                <t t-foreach="docs" t-as="doc">
                    <t t-call="report.external_layout">

                         -------------------

                         ------------------------

                          ------------------
                    </t>
                </t>
            </t>
        </template>

In reports/views/layouts.xml:

<template id="external_layout">
    <!-- Multicompany -->
    <t t-if="o and 'company_id' in o">
        <t t-set="company" t-value="o.company_id"></t>
    </t>
    <t t-if="not o or not 'company_id' in o">
        <t t-set="company" t-value="res_company"></t>
    </t>

    <t t-call="report.external_layout_header" />
    <t t-raw="0" />
    <t t-call="report.external_layout_footer" />
</template>

อวตาร
ละทิ้ง

thanks @vasanth, this code fully work..give +1 vote from me.

ok.sounds good...

Related Posts ตอบกลับ มุมมอง กิจกรรม
How to call css style in qweb report? แก้ไขแล้ว
2
ก.พ. 21
11128
4
พ.ค. 16
7708
0
มี.ค. 15
3280
1
มี.ค. 15
3773
1
มี.ค. 15
7611