Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

How to put company header only on the first page of a report?

Subscribe

Get notified when there's activity on this post

This question has been flagged
pdfqwebheaderreporting
3 Replies
13591 Views
Avatar
Pascal Tremblay

Hello gang!

I have now beautifull qweb report in PDF. But if my reports (sale order, for example) have more than one page, the header is on EACH page. 

How to put company header only on the first page?

Thanks

1
Avatar
Discard
Pascal Tremblay
Author

Somebody manage to do it? We still did not.

Pascal Tremblay
Author

May be an idea : the pseudo class :first-of-type in CSS?

Avatar
Pascal Tremblay
Author Best Answer

Ref :
        http://lolierp.blogspot.ca/2015/03/odoo-8-editions-qweb-suppression-entete.html?showComment=1430604942124

It works here. We are very happy of this!

Look image, header is only on the first page of the saleorder!!!! Great



If somebody needs XML code, it will be a pleasure to put it here. Just ask.


UPDATE 7 AUGUST 2015 - SOME CODES TO HELP!

<template id="report_lapagept.report_header_pt">

<!--Ici l'en-tête de La Page PT-->

<div class="row zero_min_height">

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

<div style="border-bottom: 3px solid #881111;" />

</div>

</div>

<div class="row" style="">

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

<span>&nbsp;</span>

<img t-if="user.company_id.logo" t-att-src="'data:image/png;base64,%s' % user.company_id.logo" style="max-height: 60px; margin-left: 5px; margin-top: 5px;" /> </div>

<div class="col-xs-9 text-right" style="padding-top: 20px;">

<span style="font-size: 20px;" t-field="user.company_id.rml_header1" />

<span>&nbsp;&nbsp;</span>

</div>

</div>

<div class="row zero_min_height">

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

<div style="margin-top: 5px; border-bottom: 3px ridge #222222;" />

</div>

</div>

<div class="row">

<div style="margin-top: 5px;" class="col-xs-4">

<div t-field="user.company_id.partner_id" t-field-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": true}" style="padding-left: 5px; padding-bottom: 5px; border-bottom: 3px solid #555544;" />

</div>

<div style="margin-top: 5px; font-size: 10px;" class="col-xs-4">

<div>TPS : 85890 5656 RT0001</div>

<div>TVQ : 1028299113 TQ0002</div>

<div>TVD : 858905656 MT0001</div>

</div>

<div style="margin-top: 5px; font-size: 11px;" class="col-xs-4">

<div>NE : 858905656</div>

<div>NEQ : 2265894800</div>

</div>

</div>

</template>

 

<template id="report_saleorder_document_lapagept" inherit_id="sale.report_saleorder_document">

<xpath expr="//div[@class='page']" position="replace">

<div style="font-family: Ubuntu;" class="page">

<div t-if="user.company_id.x_company_prefix == 'AS'">

<t t-call="report_lapagept.report_header_as" />

</div>

<div t-if="user.company_id.x_company_prefix == 'PT'">

<t t-call="report_lapagept.report_header_pt" />

</div>

<div t-if="user.company_id.x_company_prefix == 'IV'">

<t t-call="report_lapagept.report_header_iv" />

</div>

<div class="oe_structure"/>

<div class="row">

<div class="col-xs-4" style="">

<h4>

<strong t-if="o.partner_shipping_id == o.partner_invoice_id">Invoice and shipping address :</strong>

<strong t-if="o.partner_shipping_id != o.partner_invoice_id">Invoice address :</strong></h4>

<div style="margin-left: 20px;">

<div t-field="o.partner_invoice_id" t-field-options="{"widget": "contact","fields": ["address", "name", "phone", "fax"], "no_marker": true}"/>

<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat"/></p>

</div>

</div>

<div class="col-xs-4" style="">

<div t-if="o.partner_shipping_id != o.partner_invoice_id" class="mt8">

<h4><strong>Shipping address :</strong></h4>

<div style="margin-left: 20px;">

<div t-field="o.partner_shipping_id" t-field-options="{"widget": "contact", "fields":

["address", "name", "phone", "fax"], "no_marker": true }"/>

<p t-if="o.partner_id.vat">VAT : <span t-field="o.partner_id.vat"/></p>

</div>

</div>

</div>

<div class="col-xs-4" style="">

<h4><strong>Partner address : </strong></h4>

<div style="margin-left: 20px;">

<div t-field="o.partner_id" t-field-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": true}"/>

</div>

</div>

</div>

 

<h1>

<span t-if="o.state not in ['draft','sent']">Order : N° </span>

<span t-if="o.state in ['draft','sent']">Quotation : N° </span>

<span t-field="o.name"/>

</h1>

<div class="row mt32 mb32" id="informations">

<div t-if="o.client_order_ref" class="col-xs-3">

<strong>Your reference :</strong>

<p t-field="o.client_order_ref"/>

</div>

<div t-if="o.date_order" class="col-xs-3">

<strong t-if="o.state not in ['draft','sent']">Date ordered :</strong>

<strong t-if="o.state in ['draft','sent']">Quotation date :</strong>

<div style="margin-left: 6px;">

<p t-field="o.date_order" t-field-options='{"format": "d MMMM y"}'/> </div>

</div>

<div t-if="o.user_id.name" class="col-xs-3">

<strong>Salesperson :</strong>

<div style="margin-left: 6px;">

<p t-field="o.user_id.name"/></div>

</div>

<div t-if="o.payment_term" class="col-xs-3">

<strong>Payment term :</strong>

<div style="margin-left: 6px;"><p t-field="o.payment_term"/></div>

</div>

</div>

<table class="table table-condensed">

<thead>

<tr>

<th> Picture</th>

<th>Name</th>

<th>Description</th>

<th>Taxes</th>

<th class="text-right">Quantity</th>

<th class="text-right">Unit price</th>

<th groups="sale.group_discount_per_so_line">Discount (%)</th>

<th class="text-right">Price</th>

</tr>

</thead>

<tbody class="sale_tbody">

<tr t-foreach="o.order_line" t-as="l">

<td>

<span t-field="l.product_id.image_small" t-field-options="{"widget": "image", "height": "64"}" />

</td>

<td>

<span t-field="l.product_id.name"/>

</td>

<td>

<span t-field="l.name"/>

</td>

<td>

<span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>

</td>

<td class="text-right">

<span t-field="l.product_uom_qty"/>

<span groups="product.group_uom" t-field="l.product_uom"/>

</td>

<td class="text-right">

<span t-field="l.price_unit"/>

</td>

<td groups="sale.group_discount_per_so_line">

<span t-field="l.discount"/>

</td>

<td class="text-right">

<span t-field="l.price_subtotal" t-field-options="{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}"/>

</td>

</tr>

</tbody>

</table>

<div class="row">

<div class="col-xs-4 pull-right">

<table class="table table-condensed">

<tr class="border-black">

<td><strong>Total without taxes</strong></td>

<td class="text-right">

<span t-field="o.amount_untaxed" t-field-options="{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}"/>

</td>

</tr>

<tr>

<td>Taxes</td>

<td class="text-right">

<span t-field="o.amount_tax" t-field-options="{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}"/>

</td>

</tr>

<tr class="border-black">

<td><strong>Total</strong></td>

<td class="text-right">

<span t-field="o.amount_total" t-field-options="{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}"/>

</td>

</tr>

</table>

</div>

</div>

<p t-field="o.note"/>

<p t-if="o.payment_term.note">

<strong>Payment Term:</strong>

<span t-field="o.payment_term.note"/>

</p>

<div class="oe_structure"/>

</div>

</xpath>

</template>

</data>



0
Avatar
Discard
Aiden Andrews-McDermott

Any chance you could post other sample reports?

Pascal Tremblay
Author

Just say to me what you would want to see. No prob.

Erhuvwu Akpobaro

Hey Pascal is it possible to see some sample xml code ?

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

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

Sign up
Related Posts Replies Views Activity
Qweb pdf: print a last page horizontaly (landcape)
pdf qweb reporting
Avatar
0
Jun 20
3213
v10 custom reports module header
qweb header reporting
Avatar
Avatar
2
May 17
4691
QWEB Report issue while having large row content. Solved
qweb header reporting wkhtmltopdf
Avatar
Avatar
Avatar
2
Jun 22
8712
Odoo v8: How can old .rml header be embedded in custom qweb report?
qweb rml header reporting
Avatar
Avatar
2
Jul 15
4298
How can I display all tasks (including completed ones) in a QWeb report in Odoo?
qweb reporting
Avatar
Avatar
2
Sep 24
3037
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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