Hello,
I am building a custom PDF report in Odoo (v18) using QWeb.
- I defined a custom report.paperformat (A4, portrait) with correct margins, so my header is aligned properly.
-
The problem:
- I want the invoice lines table to stretch and fill the available vertical space until the bottom of the page.
- I also need to position a declaration/div block always at the bottom of the last page, just above the footer.
-
When I tried using Bootstrap flex / CSS positioning, it didn’t apply in the PDF output (because Odoo uses wkhtmltopdf with limited CSS support).
<div class="page">
<!-- Header (works fine) -->
<table class="inv-tbl">
<!-- invoice lines -->
</table>
<!-- I want this block always pushed to bottom -->
<div class="declaration">
Company Declaration and Bank Details
</div>
</div>
What I tried:
- Flexbox and min-height:100% → not applied.
- Absolute positioning with bottom:0 → overlaps table content.
- Adjusting paperformat margins → helps only for header, not for body stretching.
So,
What is the recommended approach in Odoo QWeb reports to:
- Stretch a table so it occupies remaining height,
- Always push a block (div) to the bottom of the last page (above footer)?
Any examples or best practices would be appreciated.