Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get company name in qweb report?

By
Mohammed Khamis
on 2/17/15, 1:00 AM 2,431 views

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

3

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 2/17/15, 1:32 AM

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.

Ankit H Gandhi(AHG)
on 2/17/15, 1:39 AM

ok.sounds good...

Vasanth
on 2/17/15, 2:14 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/17/15, 1:00 AM
Seen: 2431 times
Last updated: 3/16/15, 8:10 AM