From feafc6728033731c8fe4382fd73cc0b194ab1fbe Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 22 May 2020 15:09:45 +0000 Subject: [PATCH] [FIX] report: Font size decrease when adding too much content From the Sale app create a new Quotation with a long customer reference. Click on "Save" and then Print. In the generated report the fields relative to the order details are not correctly displayed: the general font size is scaled down to make the text fit the page which is not the correct behavior. The font size should remain fixed and all the element should be visible, eventually spanning over multiple lines. This is due to the broken bootstrap support of QtWebKit, used by wkhtmltopdf to generate pdf reports. In particular the new flexbox style introduced in the library is not supported and every element based on it will be ill-displayed. The solution is to fall back to the subset of supported features to implement a different solution, which keep everything on one line but avoid the font resizing and every possible overflow. opw-2261573 closes odoo/odoo#55555 X-original-commit: 2dd3ed327aad6fecdcfd4b53c4338bf47e44401b Signed-off-by: Nicolas Martinelli (nim) --- addons/web/static/src/scss/report.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/web/static/src/scss/report.scss b/addons/web/static/src/scss/report.scss index 86c0f986006..91500a689a7 100644 --- a/addons/web/static/src/scss/report.scss +++ b/addons/web/static/src/scss/report.scss @@ -64,3 +64,16 @@ div#total { } } } + +// Wkhtmltopdf doesn't handle flexbox properly, both the content +// of columns and columns themselves does not wrap over new lines +// when needed: the font of the pdf will reduce to make the content +// fit the page format. +// A (weak) solution is to force the content on one line and +// impose the width, so to have evenly size columns. +// This should work fine in most cases, but will yield ugly results +// when 6+ columns are rendered +.col-auto{ + -webkit-box-flex: 1 !important; + width: 100% !important; +}