Odoo Help


How to have custom header in qweb report?

on 11/24/14, 9:40 AM 12,527 views

I need to have headers report specific, I know I can inherit standard header and customize that but it becomes global header, If I inherit header in both reports it prints in one only which loads later ( later report replaces previous header). how can I have report spcific headers?

Sajin Aziz
On 11/25/14, 12:37 PM

  <div class="header">
            This Is Header

use it before <div class="page">  in report,

to re-use make it as seperate template. then u can use <t t-call="module_name.template_id"/>

Thanks @ Sajin Aziz

Ankit H Gandhi(AHG)
on 2/4/15, 3:50 AM


| 8 8 8

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

On 2/4/15, 2:19 AM

Hi Yogesh!

You actually have two options. The first is to create a new header template in the module reports, in the file layouts.xml (addons/report/views/layouts.xml). For example:

<template id="your_custom_layout_header">

<div class="header">

<div class="row">

<div class="col-xs-3">

<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
<!-- All your custom code here -->



Which you can then load in your report.

<t t-call="report.your_custom_layout_header">

The second option is to use the header element in Odoo. Before the <div class="page"> tag you can then do this:

<div class="header">
           <h3>Header title</h3>
          <t t-esc="o.name"/>

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

2 follower(s)


Asked: 11/24/14, 9:40 AM
Seen: 12527 times
Last updated: 3/16/18, 5:55 AM