Skip to content

[18.0][FIX] web: preserve report header top padding in PDF - #1344

Open
miquelrosell99 wants to merge 1 commit into
OCA:18.0from
miquelrosell99:18.0-fix-report-header-top-padding
Open

[18.0][FIX] web: preserve report header top padding in PDF#1344
miquelrosell99 wants to merge 1 commit into
OCA:18.0from
miquelrosell99:18.0-fix-report-header-top-padding

Conversation

@miquelrosell99

Copy link
Copy Markdown

Description

Odoo 18.0 commit 0184f2236804 moved report margins into CSS and added .header { padding-top: 11mm; } inside .o_body_pdf.o_css_margins. However, when wkhtmltopdf renders the header through web.minimal_layout, the header is wrapped in #minimal_layout_report_headers, so the 11 mm top padding is silently dropped. The result is that the company logo sits flush against the top edge of the page in PDF output.

This patch applies the same padding-top to #minimal_layout_report_headers .header, restoring the intended spacing in generated PDFs.

Steps to reproduce

  1. Install a fresh Odoo 18.0 database.
  2. Upload a company logo and print any standard PDF report (e.g. a quotation or invoice) using the default A4 paperformat.
  3. Observe that the logo is clipped / touching the top page margin.

Fix

Add the missing SCSS rule:

#minimal_layout_report_headers .header {
    padding-top: $o-default-report-margins;
}

Commit 0184f22 moved report margins to CSS, but the padding
applied to .header inside .o_body_pdf only. When wkhtmltopdf renders
the header through web.minimal_layout, the header is wrapped in
#minimal_layout_report_headers, so the 11 mm top padding was lost
and the company logo sits flush against the top of the page.

Add the same padding-top to #minimal_layout_report_headers .header
so the PDF output matches the browser preview again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant