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

Custom footer in report PDF

Subscribe

Get notified when there's activity on this post

This question has been flagged
odoo15reportPDF
1 Reply
2200 Views
Avatar
Aprilia Zahratunnisa

I want to make the footer at the bottom of the page, but always below the table...



<odoo>

    <template id="report_penyerahan_barang_template">

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

            <style type="text/css">

                .page {

                    position: relative;

                    width: 100%;

                    page-break-before: auto;

                }


                /* Memaksa halaman kedua dan seterusnya untuk dimulai dari halaman baru */

                .page:nth-of-type(n+2) {

                    page-break-before: always;

                }


                .header {

                    width: 100%;

                }


                .header td p {

                    margin: 0;

                }


                .footer {

                    position: fixed;

                    bottom: 0;

                }


                h2 {

                    margin: 0;

                }


                .table {

                    border-collapse: collapse;

                    width: 100%;

                    border: solid;

                    border-width: 1px;

                }


                .table th, .table td {

                    padding: 0px;

                    border: solid;

                    border-width: 1px;

                }


                .table-wrapper {

                    max-height: calc(9 * 3px);

                    border: 1px solid #ccc;

                }


                .table-collapse td {

                    font-size: 14px;

                }


                .td p {

                    margin: 0;

                }

            </style>


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

                <t t-set="items_per_page" t-value="8"/>

                <t t-set="total_items" t-value="len(picking.move_lines)"/>

                <t t-set="page_count" t-value="(total_items + items_per_page - 1) // items_per_page"/>

                <t t-set="move_lines" t-value="picking.move_line_ids.filtered(lambda l: l.qty_done > 0).sorted(lambda l: l.product_id.default_code or '')"/>

                <t t-set="total_moves" t-value="len(move_lines)"/>

                <t t-set="chunks" t-value="[]"/>

                <t t-set="page_idx" t-value="0"/>


                <t t-foreach="range(0, total_moves, items_per_page)" t-as="i">

                    <t t-set="chunks" t-value="chunks + [move_lines[i:i + items_per_page]]"/>

                </t>


                <t t-foreach="chunks" t-as="chunk">

                    <div class="page">

                        <br/>

                        <br/>

                        <br/>

                        <header>

                            <h2 style="text-align: center;">SURAT PENYERAHAN BARANG</h2>

                            <table style="margin-top: 3px;" class="header">

                                <tr>

                                    <td style="font-size: 14px; width: 73%;">

                                        <p>

                                            <strong>Kepada Yth:</strong>

                                            <t t-esc="picking.sale_id.partner_invoice_id.name"/>

                                        </p>

                                        <p style="margin-bottom: 3px; min-height: 20px;">

                                            <t t-esc="picking.sale_id.partner_invoice_id.street"/>

                                        </p>

                                        <p>

                                            <strong>Diserahkan Kepada:</strong>

                                            <t t-esc="picking.partner_id.name"/>

                                        </p>

                                        <p style="margin-bottom: 2px; min-height: 20px;">

                                            <t t-esc="picking.partner_id.street"/>

                                        </p>

                                        <p>

                                            <strong>No. PO:</strong>

                                            <t t-esc="picking.sale_id.reference_po"/>

                                        </p>

                                    </td>

                                    <td style="font-size: 15px; width: 14%;">

                                        <p>No. SPB</p>

                                        <p>Tgl SPB</p>

                                        <p>Nama Ekspedisi</p>

                                        <p>No Kendaraan</p>

                                    </td>

                                    <td style="font-size: 16px; width: 1%;">

                                        <p>: </p>

                                        <p>: </p>

                                        <p>: </p>

                                        <p>: </p>

                                    </td>

                                    <td style="font-size: 15px; width: 12%;">

                                        <t t-set="page_idx" t-value="page_idx or 0"/>

                                        <p>Hal: <t t-esc="page_idx + 1"/> / <t t-esc="page_count"/></p>

                                        <p><t t-esc="picking.name"/></p>

                                        <p style="margin-bottom: 50%;"> <t t-esc="datetime.datetime.now().strftime('%d-%m-%Y')"/> </p>

                                    </td>

                                </tr>

                            </table>

                        </header>

                        <section>

                            <!-- Bungkus tabel dalam div untuk max-height -->

                            <div class="table-wrapper">

                                <table class="table">

                                    <thead>

                                        <tr>

                                            <th>No</th>

                                            <th>Kuantitas</th>

                                            <th>Kode Barang</th>

                                            <th>Nama Barang</th>

                                            <th>No. SO</th>

                                        </tr>

                                    </thead>

                                    <tbody>

                                        <t t-set="counter" t-value="1 + page_idx * items_per_page"/>

                                        <t t-foreach="chunk" t-as="move_line">

                                            <tr>

                                                <td style="text-align: center; width: 4%; font-size: 16px;">

                                                    <t t-esc="counter"/>

                                                    <t t-set="counter" t-value="counter + 1"/>

                                                </td>

                                                <td style="text-align: center; font-size: 12px;">

                                                    <table style="width: 100%; border: none;">

                                                        <tr>

                                                            <td style="text-align: left; border: none;">

                                                                <t t-esc="int(move_line.qty_done)"/> EA

                                                            </td>

                                                            <td style="text-align: right; border: none;">

                                                                <t t-esc="move_line.product_id.default_code.split('-', 2)[-1]"/>

                                                            </td>

                                                        </tr>

                                                    </table>

                                                </td>

                                                <td style="text-align: left; width: 20%; font-size: 16px;">

                                                    <t t-if="move_line.product_id.default_code">

                                                        <t t-esc="move_line.product_id.default_code"/>

                                                    </t>

                                                    <t t-else="">N.A</t>

                                                </td>

                                                <td style="width: 43%; font-size: 16px;">

                                                    <t t-esc="move_line.product_id.name"/>

                                                </td>

                                                <td style="text-align: center; width: 16%; font-size: 16px;">

                                                    <t t-esc="picking.sale_id.name"/>

                                                </td>

                                            </tr>

                                        </t>

                                    </tbody>

                                </table>

                            </div>

                        </section>

                        <footer>

                            <table style="width: 100%;">

                                <tr>

                                    <td class="td" style="width: 40%; text-align: left;font-size: 14px;">

                                        <p>Diterima Oleh :</p>

                                        <p style="margin-bottom: 100px;">(Pembeli)</p>

                                        <p>Nama</p>

                                        <p>Tgl.</p>

                                    </td>

                                    <td class="td" style="width: 35%; text-align: left; font-size: 14px;">

                                        <p>Diserahkan Oleh :</p>

                                        <p style="margin-bottom: 100px; margin-top: 0;">(Kepala Gudang)</p>

                                        <p>Nama</p>

                                        <p style="margin-top: 0;">Tgl.</p>

                                    </td>

                                    <td class="td" style="width: 35%; text-align: left; font-size: 14px;">

                                        <p>Dibuat Oleh :</p>

                                        <p style="margin-bottom: 100px; margin-top: 0;">(Adm. Penjualan)</p>

                                        <p>Nama</p>

                                        <p style="margin-top: 0;">Tgl.</p>

                                    </td>

                                </tr>

                            </table>

                        </footer>

                        <t t-set="page_idx" t-value="page_idx + 1"/>

                    </div>

                </t>

            </t>

        </t>

    </template>

</odoo>



0
Avatar
Discard
Avatar
Nikhil Nakrani
Best Answer

Hi,

I hope you are doing well,

<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout">
<!-- <div class="text-center" style="background-color: #15003d;font-size:13px;padding-botton:0px;"> -->
<div class="text-center">
<ul class="list-inline mb4">
<div t-field="company.report_footer"/>
<table class="table table-sm table-striped" style="zoom:75%;">
<tbody>
<tr>
<td colspan="2">
<center>Your content</center>
</td>
</tr>
<tr>
<td colspan="2">
<center>This is a Computer Generated Invoice
</center>
</td>
</tr>
</tbody>
</table>
</ul>
<div t-if="report_type == 'pdf'" class="text-muted">
<strong>TAX INVOICE (Page
<span class="page"/>)
</strong>
</div>
</div>
</div>

Can you try above code This is Odoo by deafult use.

You can user this class in your footer tag.

footer at the bottom of the page and always below after body content.

Thanks.

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
Related Posts Replies Views Activity
Error install web_responsive in odoo 15
odoo15
Avatar
0
Sep 24
1781
Create a button next to the chat one or activities
odoo15
Avatar
Avatar
1
Jun 24
2176
I can't import reordering rules other company
odoo15
Avatar
Avatar
1
May 24
2331
one2many search widget
odoo15
Avatar
Avatar
Avatar
Avatar
3
May 24
2504
float_compare validation fails for standard_price in custom module due to decimal precision
Decimal-precision odoo15
Avatar
Avatar
Avatar
Avatar
3
Sep 25
954
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