Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to add page number in Qweb reports in odoo

Naroči se

Get notified when there's activity on this post

This question has been flagged
3 Odgovori
37950 Prikazi
Avatar
Gopakumar N G

How to add page numbers as page X of Y in Qweb reports in odoo.

3
Avatar
Opusti
Cliff Kujala

Have you tried my solution below? If it helps, please upvote.

Avatar
Cliff Kujala
Best Answer

Try this:

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

But keep in mind, this will only work when the report type is PDF, not HTML.

I am not using external_layout_footer in my Sales Order/Quote or Invoice Qweb report printouts. I instead have the header and footer written directly into the "document" Qweb views. My footer looks like this, which will give you a nice small Page Y of X in the lower left corner of the page.

<div class="footer">
            <div class="row">
                <div class="col-xs-2 pull-left">
                    <small>
                        <span>Page</span>
                        <span class="page" />
                        of
                        <span class="topage" />
                    </small>
                </div>
            </div>
        </div>

Try this out for a header:

<div class="header">
            <div class="row">
                <div class="col-xs-3">
                    <!-- <img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 125px;"/> -->
                </div>
                <small>
                <div class="col-xs-2 text-right">
                    <div t-field="o.company_id.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
                </div>
                <div class="col-xs-2">
                    <div t-field="o.company_id.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;phone&quot;, &quot;website&quot;, &quot;email&quot;], &quot;no_marker&quot;: true}"/>
                </div>
                </small>
                <div class="col-xs-4">
                    <span class="text-right">
                        <h4>
                            <span t-if="o.state not in ['draft','sent']">Order N°</span>
                            <span t-if="o.state in ['draft','sent']">Quote N°</span>
                            <span t-field="o.name" />
                        </h4>
                    </span>
                    <small>
                        <div class="row">
                            <div class="col-xs-8 text-right">
                                <span t-if="o.state not in ['draft','sent']">Order Date</span>
                                <span t-if="o.state in ['draft','sent']">Quote Date</span>
                            </div>
                            <div class="col-xs-4 text-right">
                                <span t-field="o.date_order" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-8 text-right">
                                <span t-if="o.write_date">Modified Date</span>
                            </div>
                            <div class="col-xs-4 text-right">
                                <span t-field="o.write_date" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-8 text-right">
                                <span t-if="o.user_id.name">Salesperson</span>
                            </div>
                            <div class="col-xs-4 text-right">
                                <span t-field="o.user_id.name" />
                            </div>
                        </div>
                    </small>
                </div>
            </div>
            <div class="row">
            <small>
                <div class="col-xs-2">
                    <strong>Customer</strong>
                    <div t-field="o.partner_invoice_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}" />
                </div>
                <div class="col-xs-2">
                    <strong>Contact</strong>
                    <div t-field="o.partner_invoice_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;phone&quot;, &quot;mobile&quot;, &quot;email&quot;], &quot;no_marker&quot;: true}" />
                </div>
                <div class="col-xs-2">
                    <strong>Shipping Address</strong>
                    <div t-if="o.partner_shipping_id == o.partner_invoice_id">Same as billing</div>
                    <div t-if="o.partner_shipping_id != o.partner_invoice_id">
                        <div t-field="o.partner_shipping_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;], &quot;no_marker&quot;: true}" />
                    </div>
                </div>
                <div class="col-xs-6">
                    <!-- rest of customer ref info -->
                    <strong t-if="o.state not in ['draft','sent']">Order Terms</strong>
                    <strong t-if="o.state in ['draft','sent']">Quote Terms</strong>
                    <div class="row">
                        <div class="col-xs-6">
                            <div t-if="o.client_order_ref">
                                PO / Ref:
                                <span t-field="o.client_order_ref" />
                            </div>
                            <div t-if="o.payment_term">
                                Term:
                                <span t-field="o.payment_term" />
                            </div>
                            <div t-if="o.incoterm">
                                Incoterm:
                                <span t-field="o.incoterm" />
                            </div>
                            <div t-if="o.carrier_id">
                                Delivery Method:
                                <span t-field="o.carrier_id" />
                            </div>
                        </div>
                        <div class="col-xs-6">
                            <div t-if="o.state in ['draft','sent']">
                                <div t-if="o.validity_date">
                                    Expiry Date:
                                    <span t-field="o.validity_date" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}" />
                                </div>
                            </div>
                            <div t-if="o.requested_date">
                                Requested Date:
                                <span t-field="o.requested_date" t-field-options="{&quot;format&quot;: &quot;yyyy-MM-dd&quot;}" />
                            </div>
                            <div t-if="o.state">
                                Status:
                                <span t-field="o.state" />
                            </div>
                        </div>
                    </div>
                
                </div>
            </small>
            </div>
</div>

5
Avatar
Opusti
Shawn Varghese

Does this work everywhere on the report? This line seemed to display the page number only when it was placed in the external_layout_footer template.

Cliff Kujala

I am not using external_layout_footer in my Sales Order/Quote or Invoice Qweb report printouts. I instead have the header and footer written directly into the "document" Qweb views. My footer looks like this:

Page of
Shawn Varghese

Post it as an answer... that part supports markup

Gopakumar N G
Avtor

@Cliff Kujala Is it possible to add the header in all pages of the report?

Cliff Kujala

@ Gopakumar N G Yes this is possible. I will edit my answer above so you can see the code to add a header inside the "document" Qweb view.

Cliff Kujala

Are you viewing as PDF or HTML? It will only work as PDF. You also need to make sure you are calling out the class of the span tag correctly. See html/xml as written above. Anything that doesn't pass strict XML won't work.

Gopakumar N G
Avtor

@Cliff Kujala For getting the header in all pages of the report, the div with class="header"is to be added in which part of the report? Could you please provide your report file or post it in the answer?

Avatar
Vasanth
Best Answer

Try this in xml.view:

<template id="external_layout_footer">
    <div class="footer">
        <div class="text-center" style="border-top: 1px solid black;">        

            <ul class="list-inline">
                <li>Page:</li>
                <li><span class="page"/></li>
                <li>/</li>
                <li><span class="topage"/></li>
            </ul>
        </div>
    </div>     

</template>

5
Avatar
Opusti
Ankit H Gandhi(AHG)

Thanks @vasanth this code very helpfull for me

Alfa y Omega Pachuca

How i can img to footer, i have my own module but i can add images with the images do not show up.

Avatar
vishal
Best Answer

tell me without using external and internal layout'

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

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

Prijavi
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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