İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

[Odoo 17] Extra Space at Top and Bottom in Custom Report after Removing Default Header/Footer

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
2 Cevaplar
1264 Görünümler
Avatar
MOHAMED

Hi everyone,

I'm working on a custom report in Odoo 17, and I've run into an issue with the layout.

I created a new report_paperformat and a custom report template. I removed the default Odoo header (web.external_layout) and footer, but I still have extra white space at the top and bottom of the generated PDF.

Here’s what I’ve already tried:

  • Replaced <t t-call="web.external_layout"> with my own layout using t-foreach="docs".
  • Removed any t-call="web.internal_layout" as well.
  • Defined a new paper format in report_paperformat.xml with margins set to 0.

Despite this, the PDF still includes a blank area at the top and bottom — it seems like the old margins are still applied.

🔧 My paperformat XML:

xml

CopyEdit

<record id="custom_report_paperformat" model="report.paperformat"> <field name="name">Custom Format</field> <field name="default" eval="True"/> <field name="format">A4</field> <field name="margin_top">0</field> <field name="margin_bottom">0</field> <field name="margin_left">0</field> <field name="margin_right">0</field> <field name="header_line" eval="False"/> <field name="orientation">Portrait</field> <field name="page_height">0</field> <field name="page_width">0</field> <field name="dpi">90</field> </record>

❓Question:

How can I completely remove the top and bottom spacing in the report PDF?

Is there a way to force zero margin rendering, or do I need to override something in the QWeb rendering engine or CSS?

Thank you in advance!

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,


This is a common issue when working with custom PDF reports in Odoo. Even after setting margins to 0 and removing the header/footer, white space may still appear. Here's how to solve it completely:


Corrected Paper Format XML:

The issue is likely caused by setting page_height and page_width to 0, which tells wkhtmltopdf to fall back to default A4 size with default margins.

You should explicitly define A4 dimensions in mm:


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

    <field name="name">Custom Format</field>

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

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

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

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

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

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

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

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

    <field name="page_height">297</field> <!-- A4 height in mm -->

    <field name="page_width">210</field>  <!-- A4 width in mm -->

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

</record>


Attach the Paper Format to the Report

Ensure your custom report uses this paper format:


<record id="your_custom_report_action" model="ir.actions.report">

    <field name="paperformat_id" ref="your_module.custom_report_paperformat"/>

</record>


Hope it helps.


1
Avatar
Vazgeç
Avatar
John
En İyi Yanıt

Defining a custom report and paper format and removing the default web.external_layout is the correct way to remove default Odoo headers/footers and control layout. However, extra white space still appears in the PDF, which is a common issue due to how wkhtmltopdf handles margins, especially when there are conflicts between HTML/CSS and paper format.


✅ 1. Check Report Paper Format Linkage

Make sure your report is correctly linked to the custom paperformat. In your report.xml or report_action record, add:


<record id="action_report_my_custom" model="ir.actions.report">

    <field name="name">My Custom Report</field>

    <field name="report_name">my_module.report_template_id</field>

    <field name="report_type">qweb-pdf</field>

    <field name="paperformat_id" ref="my_module.custom_report_paperformat"/>

</record>

✅ 2. Set All Margins and Page Sizes Correctly

Your paper format XML looks mostly good. Here's a safer version:

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

    <field name="name">Custom Format</field>

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

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

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

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

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

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

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

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

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

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

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

</record>

👉 Setting both page_height and page_width to 0 tells Odoo to use the standard A4 dimensions as per the format field.

✅ 3. Force CSS Margin Reset in Template

Sometimes, QWeb adds padding/margins via the stylesheet (report.min.css). Add a style override to your template:



<t t-name="my_module.report_template_id">

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

        <t t-set="css">

            <![CDATA[

                @page {

                    margin: 0mm !important;

                }

                body {

                    margin: 0mm !important;

                    padding: 0mm !important;

                }

                .page {

                    margin: 0mm !important;

                    padding: 0mm !important;

                }

            ]]>

        </t>

        <div class="page">

            <!-- your content -->

        </div>

    </t>

</t>

✅ This helps override any default layout styling inside .page, body, or @page.

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

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

Üye Ol
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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