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

Headers and Footers don't appears on reports after customization

Subscribe

Get notified when there's activity on this post

This question has been flagged
3 Replies
8121 Views
Avatar
Ben

Hello everyone,

I am customizing some reports in Odoo but I have encountered a problem for some time that I can not find the solution.

In fact, on all my reports the footers do not appear and the header appears only on the first page and not on the rest, I tried several solutions that I found on the net but without success.

I work on odoo 11 Enterprise version, Ubuntu 16.04, wkhtmltopdf 0.12.2.4-1, wkhtmltox 0.12.1.

Thank you for helping me

0
Avatar
Discard
Avatar
Ben
Author Best Answer

Hello Daniel John,

here is my code, hope it will help you

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<!-- Format paper -->

<record id="paperformat_purchasepo_radiocom" model="report.paperformat">

<field name="name">European A4 Purchase PO Radiocom</field>

<!--field name="default" eval="True"/-->

<field name="format">A4</field>

<field name="page_height">0</field>

<field name="page_width">0</field>

<field name="orientation">Portrait</field>

<field name="margin_top">1</field>

<field name="margin_bottom">29</field>

<field name="margin_left">7</field>

<field name="margin_right">7</field>

<field name="header_line" eval="False"/>

<field name="header_spacing">10</field>

<field name="dpi">90</field>

</record>

<!-- Private templates used internally by reports -->

<!-- LAYOUT -->

<template id="layout" name="Report layout">&lt;!DOCTYPE html&gt;

<html t-att-lang="lang and lang.replace('_', '-')"

t-att-data-editable="'1' if editable else None"

t-att-data-translatable="'1' if translatable else None"

t-att-data-edit_translations="'1' if edit_translations else None"

t-att-data-main-object="repr(main_object) if editable else None"

t-att-data-report-margin-top="data_report_margin_top"

t-att-data-report-header-spacing="data_report_header_spacing"

t-att-data-report-dpi="data_report_dpi">

<head>

<meta charset="utf-8" />

<meta name="viewport" content="initial-scale=1"/>

<title><t t-esc="title or 'Odoo Report'"/></title>

<!--t t-call-assets="report.assets_common"/>

<t t-if="editable">

<t t-call-assets="web_editor.assets_editor"/>

<t t-call-assets="report.assets_editor"/>

</t-->

</head>

<body class="container" t-att-style="editable and 'margin-top: 40px;'">

<div id="wrapwrap">

<main>

<t t-raw="0"/>

</main>

</div>

</body>

</html>

</template>

<!-- HTML CONTAINER -->

<template id="html_container">

<t t-set="body_classname" t-value="'container'"/>

<t t-call="purchase_customize.layout">

<t t-raw="0"/>

</t>

</template>

<!-- EXTERNAL LAYOUT -->

<template id="external_layout">

<!-- Multicompany -->

<t t-if="o and 'company_id' in o">

<t t-set="company" t-value="o.company_id"></t>

</t>

<t t-if="not o or not 'company_id' in o">

<t t-set="company" t-value="res_company"></t>

</t>

<!--t t-call="purchase_customize.external_layout_header" /-->

<div class="article o_report_layout_boxed">

<t t-raw="0" />

</div>

<t t-call="purchase_customize.external_layout_footer" />

</template>

<!-- FOOTER -->

<template id="external_layout_footer">

<div class="footer">

<div class="text-center" style="border-top:1px dotted #000000">

<ul class="list-inline mb4">

<li t-if="company.street"><span t-field="company.street"/></li>

</ul>

<ul class="list-inline mb4">

<li t-if="company.phone">Phone: <span t-field="company.phone"/></li>

<li t-if="company.email">Email: <span t-field="company.email"/></li>

<li t-if="company.website">Web: <span t-field="company.website"/></li>

<li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'TIN'"/>: <span t-field="company.vat"/></li>

</ul>

<div name="financial_infos">

<span t-field="company.report_footer"/>

</div>

<div class="text-muted">

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

</div>

</div>

</div>

</template>

<report

string="Purchase Order"

id="action_report_purchase_order_an"

model="purchase.order"

report_type="qweb-pdf"

name="purchase_customize.report_purchaseorderan_customise"

file="purchase_customize.report_purchaseorderan_customise"

paperformat="purchase_customize.paperformat_purchasepo_radiocom"

print_report_name="

(object.state in ('draft', 'sent') and 'Request for Quotation - %s' % (object.name) or

'English Purchase Order - %s' % (object.name))"

/>

<!-- Purchase Order Anglais -->

<template id="report_purchaseorderan_document_customise">

<t t-call="purchase_customize.external_layout">

<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>

<style type="text/css">

header{

height:10px;

}

.page{

font-size:16px !important;

color:#000000 !important;

font-family: Arial, Helvetica, sans-serif !important;

}

#contenant{

font-size:16px !important;

}

.table tr td{

color:#000000 !important;

}

#tabheader tr td{

color:#000000 !important;

}

</style>

<div class="header">

</div>

<div class="page" width="150%" id="contenant">

<table class="table table-condensed" border-collapse="0px;" style="height:1200px;">

<thead>

<tr>

<td t-att-colspan="6" style="border:1px solid #ffffff !important;border-bottom:2px solid #1d0296 !important;">

<center>

<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % to_text(o.company_id.logo)" style="height: 75px;" width="400px"/>

</center>

</td>

</tr>

<tr>

<th class="text-left" t-att-colspan="3" style="border:1px solid #ffffff !important;padding-top:3px !important;vertical-align:top;">

<br/><strong></strong>

<strong><span t-field="o.company_id.partner_id"

t-options='{"widget": "contact", "fields": ["name"], "no_marker": True}'/>

</strong>

<ul class="list-block" style="list-style-type: none !important;font-weight:normal !important;">

<li><span t-field="o.company_id.street"/></li>

<li><span t-field="o.company_id.street2"/>, <span t-field="o.company_id.city"/>,

<span t-field="o.company_id.country_id"/></li>

<li>Tel.: <span t-field="o.company_id.phone"/></li>

<li>CD/KIN/RCCM/14-B-3454, ID.NAT.01-73-N 32550 T Numero Impot: A0700120P</li>

</ul>

</th>

<th class="text-left" t-att-colspan="3" style="border:1px solid #ffffff !important;padding-top:3px !important;vertical-align:top;">

<strong>Supplier:</strong>

<br/><span t-field="o.partner_id"

t-options='{"widget": "contact", "fields": ["name"], "no_marker": True}'/>

<ul class="list-block" style="list-style-type: none !important;font-weight:normal !important;">

<li><span t-field="o.partner_id.street"/></li>

<li><span t-field="o.partner_id.street2"/>, <span t-field="o.partner_id.city"/>,

<span t-field="o.partner_id.country_id"/></li>

<li>Tel.: <span t-field="o.partner_id.mobile"/></li>

</ul>

</th>

</tr>

<tr>

<th class="text-left" t-att-colspan="6" style="border:1px solid #ffffff !important;">

<p>Shipping address:</p>

</th>

</tr>

<tr>

<th class="text-left" t-att-colspan="6" style="border:1px solid #ffffff !important;">

<center>

<h3> Purchase Order Confirmation No. - : <span t-field="o.name"/></h3>

</center>

</th>

</tr>

<tr>

<th class="text-center" style="border:1px solid #ffffff !important;border-bottom:1px solid #000000 !important;">

<span><strong style="padding:2px;text-align:center;">Our Order Reference:</strong><br/><p style="font-weight:normal !important;" t-field="o.name"/></span>

</th>

<th class="text-center" style="border:1px solid #ffffff !important;border-bottom:1px solid #000000 !important;" t-att-colspan="3">

<span><strong style="padding:2px;">our Order Reference:</strong><br/><p style="font-weight:normal !important;" t-field="o.partner_ref"/></span>

</th>

<th class="text-center" style="border:1px solid #ffffff !important;border-bottom:1px solid #000000 !important;" t-att-colspan="2">

<span><strong style="padding:2px;">Order Date:</strong>

<p style="font-weight:normal !important; text-align:center;" t-field="o.date_order" t-field-options='{"format": "d/M/y"}'/></span>

</th>

</tr>

<tr>

<th class="text-center" style="border:1px solid #000000 !important;">Description</th>

<th class="text-center" style="border:1px solid #000000 !important;">Date Req. </th>

<th class="text-center" style="border:1px solid #000000 !important;">Qty</th>

<th class="text-center" style="border:1px solid #000000 !important;">Unit Price</th>

<th class="text-center" style="border:1px solid #000000 !important;">Taxes</th>

<th class="text-center" style="border:1px solid #000000 !important;">Amount</th>

</tr>

</thead>

<tbody>

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

<td>

<strong><span t-field="line.name"/></strong>

</td>

<td class="text-center">

<span t-field="line.date_planned" t-field-options='{"format": "d/M/y"}'/>

</td>

<td class="text-right">

<span t-field="line.product_qty"/>

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

</td>

<td class="text-right">

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

</td>

<td>

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

</td>

<td class="text-right" style="background-color: transparent !important;">

<span t-field="line.price_subtotal"

t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

</td>

</tr>

</tbody>

<tbody>

<tr>

<td t-att-colspan="6" style="background-color: transparent !important;">

<table width="100%">

<tr>

<td style="border:1px solid #ffffff;" width="65%">

<p style="padding:5px"><strong>Amount in Word: </strong>

<span t-field="o.amount_letter"/></p>

</td>

<td style="background-color: transparent !important;border:1px solid #ffffff;" width="35%">

<table class="table table-condensed" style="min-width:200px;max-width: 350px;">

<tr>

<td class="text-left" style="border:1px solid #000000 !important;"><strong>Subtotal</strong></td>

<td class="text-right" style="background-color: transparent !important;border:1px solid #000000 !important;">

<span t-field="o.amount_untaxed"

t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

</td>

</tr>

<tr>

<td>Taxes</td>

<td class="text-right" style="background-color: transparent !important;border:1px solid #000000 !important;">

<span t-field="o.amount_tax"

t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

</td>

</tr>

<tr>

<td style="background-color: transparent !important;border:1px solid #000000 !important;"><strong>Total</strong></td>

<td class="text-right" style="background-color: transparent !important;border:1px solid #000000 !important;">

<span t-field="o.amount_total"

t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

</td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

</tbody>

<tfooter style="border:1px solid #ffffff !important;">

<tr>

<td t-att-colspan="6" style="background-color: transparent !important;">

<p style="text-align:left;">Select please</p>

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

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

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

<strong>ETA:</strong><br/>

<span>Date:</span>

<p t-field="o.date1" t-field-options='{"format": "d/M/y"}'/>

</div>

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

<strong>Transport:</strong><br/>

<span>By Air:</span>

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

</div>

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

<strong>Inspection:</strong><br/>

<span>Yes:</span>

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

</div>

</div>

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

<p style="padding:5px;text-align:right"><strong>

<em>Stamp &amp; Signature</em>

</strong></p>

</div>

<div class="col-xs-8" style="float:left;">

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

<span>Date:</span>

<p t-field="o.date1" t-field-options='{"format": "d/M/y"}'/>

</div>

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

<span>By Sea:</span>

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

</div>

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

<span>No:</span>

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

</div>

</div>

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

<p style="padding:5px;text-align:right"/>

</div>

<div class="col-xs-8" style="float:left;padding-left:20px;">

<p style="padding:5px;text-align:left">

<strong>Forwarder name:</strong>

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

<br/><br/>

</p>

</div>

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

<p style="padding:5px;text-align:right">

<strong>Order Approved</strong>

<br/><br/>

</p>

</div>

</div>

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

</td>

</tr>

</tfooter>

</table>

<div class="oe_structure"/>

</div>

</t>

</template>

<template id="report_purchaseorderan_customise">

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

<t t-foreach="docs" t-as="o">

<t t-call="purchase_customize.report_purchaseorderan_document_customise" t-lang="o.partner_id.lang"/>

</t>

</t>

</template>

</odoo>

0
Avatar
Discard
Avatar
Manish Bohra
Best Answer

Hello ,

Call external layout i hope it's help you .

<template id="Sales.report_xyz_document">

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

Inside your code

</t>

</template>

0
Avatar
Discard
Avatar
Dan Support
Best Answer

Provide your code so we can have a look to provide help

0
Avatar
Discard
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
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