Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to add page number in Qweb reports in odoo

Odoberať

Get notified when there's activity on this post

This question has been flagged
3 Replies
37937 Zobrazenia
Avatar
Gopakumar N G

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

3
Avatar
Zrušiť
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
Zrušiť
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
Autor

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

@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
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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