Maintainers
This module is part of the sygel-technology/sy-reporting-engine project on GitHub.
You are welcome to contribute.
This module allows users to adjust the font size of company PDF reports (invoices, sales orders, delivery slips, etc.) directly from the document layout settings.
For advanced visual customization (colors, margins, spacing, etc.), custom CSS can be defined in developer mode. Changes apply globally per company.
Table of contents
To configure the font size, you need to:
To directly customize the report css, you need to
Custom CSS affects all company PDF reports and should only be modified by a technical user.
Here you have a list of css code examples you can insert into the custom css.
Usefull css properties:
line-height: 1.5; font-weight: 300; margin: 0 100px; color: blue;
Special css selectors. Some text blocks of the reports are not edited by normal css because they use special classes that overwrite the main css, you should use this special css selectors to edit those blocks:
h2 {
color: blue;
}
#informations strong {
color: blue;
}
table * {
color: blue !important;
}
Font size css. It can be usefull knowing that the font size fields of the form view injects a css similar to the following one, with the same attributes and selectors:
font-size: 16.0px;
h2 {
font-size: 32.0px;
}
To use this module, print a report after changing the configuration. The font size will be your configured one.
This module replaces the old “reports_font_size” module
More css units can be added.
The names of the added variables (text_size, text_size_unit…) are too generic, and could be added by Odoo in the next versions. Check if this happened in the future migrations
The _get_asset_style_b64() call when updating the web.asset_styles_company_report attachment has been overwritten, replacing it for _custom_get_asset_style_b64(). The reason is that, without this change, a update of the base module deletes the css injection. Modules that inherits the _get_asset_style_b64 function might be incompatible. This was the only way found to fix this issue.
If a report uses special custom classes, the font size could not be changed. It is not common, but it has been detected that it happens with the boxed reports in v16. It can also happen if a report uses headers other than h2. If this happens to you, tell the technician who creates CSS for you. Example to solve the size of headers 1, and the direction of the boxed:
font-size: 20px;
h1 {
font-size: 40px;
}
.o_boxed_header {
font-size: 20px;
}
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
This module is part of the sygel-technology/sy-reporting-engine project on GitHub.
You are welcome to contribute.