Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Use custom header in qweb odoo 11

Subscriure's

Get notified when there's activity on this post

This question has been flagged
4 Respostes
20559 Vistes
Avatar
bjr

Hello everyone,

In odoo 11 I''d like to use a custom header for each document 

<template id="templ_id">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">

<div class="header">
my header
</div>
.......................

This code gets the default odoo header.

What shuld I do to get my own header?

Thanks

0
Avatar
Descartar
Avatar
Rishan Malaka
Best Answer

Hi,

Don't use web.external_layout and replace it with <t t-call="web.internal_layout">. after that follow bellow steps and comment out the default internal layout details.

Settings -> Technical -> Views -> Go to the internal_layout

and comment bellow code segment.


Then you can define your custom header on your header tag.


Cheers!  

1
Avatar
Descartar
bjr
Autor

But this solution it will apply also for other documents that call internal layout.

For each document I should define a header.

Thanks

Avatar
HIREN DANGAR
Best Answer

Hello bjr Please try below code I'm 100% sure this code is working for you.
You can create your custom Header and Footer as par your requirement but don't forget to use this way.

First custom header template :- 

<template id="custom_my_layout_footer">

            <div class="footer">

                <div class="text-center">

                    <ul class="list-inline">

                        <li class="col-xs-2" style="background-color:rgba(31, 32, 65, 1);color:#fff;">Printed By:-</li>

                        <li class="col-xs-7" style="text-align:center;background-color:rgba(31, 32, 65, 1);color:#fff;">

                            Page: <span class="page"/> / <span class="topage"/>

                        </li>

                        <li class="col-xs-3" style="background-color:rgba(31, 32, 65, 1);color:#fff;">

                            <span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M:%S')"/>

                        </li>

                    </ul>

                </div>

            </div>

        </template>

Custom footer template:-

<template id="partner_external_footer">

            <div class="footer">

                <div class="footer">

                    <strong>

                        This is computer generated invoice no signature required.

                    </strong>

                </div>

            </div>

        </template>


Second create main external template and call above temple into this template :- 

<template id="jt_report_external_layout">

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

            <div class="article">

                <t t-call="jt_my_invoice_report.custom_layout_header_my"/>

                <t t-raw="0"/>

                <t t-call="jt_my_invoice_report.custom_my_layout_footer"/>

            </div>

        </template>

Last point :-    Use this jt_report_external_layout template into your main report template after the <t t-call="web.html_container"> of any report template.    


 <template id="jt_my_account_report_invoice_document1">

            <t t-call="web.html_container">

                <t t-call="jt_my_invoice_report.jt_report_external_layout">


1
Avatar
Descartar
Avatar
Sehrish
Best Answer

Try this one:

    <template id="report_student_on_probation">
          <t t-call="report.layout">
            <div class="page">
                <div class="text-center">
                    <h4><b>Hello This is Custom Report (Odoo QWEB)</b></h4>
                </div>
           </div>
           </t>
 </template>


1
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now