From 08b2d1f9ac2d1423d56f1cbf8b29be9518edfd1b Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 18 Feb 2019 09:43:57 +0000 Subject: [PATCH] [FIX] web: margin-top on top of report The margin-top/margin-bottom on a address on the top of the report does not work because: - display flex on an address in wkhtmltopdf is not perfectly implemented and seems to remove vertical margin - margin-top on the page first visible element is removed To fix this issue, this code remove the display:flex on the address widget and add an empty "visible" element at the start of pages. opw-1925894 closes #31184 --- addons/web/static/src/scss/report.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/web/static/src/scss/report.scss b/addons/web/static/src/scss/report.scss index e901b5b9364..d05fd47ded0 100644 --- a/addons/web/static/src/scss/report.scss +++ b/addons/web/static/src/scss/report.scss @@ -30,6 +30,18 @@ body { page-break-inside: avoid; } +/* Avoid flex removing vertical margin */ +div.address.row { + display: block; +} + +/* margin-top does not work on first visible element of page */ +body > *:first-child::before { + content: '\00a0'; + display: block; + height: 1px; +} + /* Wkhtmltopdf doesn't support very well the media-print CSS (depends on the version) */ .d-print-none{ display: none;