Odoo Help


How to get company name in qweb report?

Mohammed Khamis
on 2/17/15, 1:00 AM 4,878 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




| 5 3 8
Pondicherry, India
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">




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-if="not o or not 'company_id' in o">
        <t t-set="company" t-value="res_company"></t>

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

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...

on 2/17/15, 2:14 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


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