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!