[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) <nim@odoo.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user