[16.0] [ADD] report_wkhtmltopdf_paperformat_from_template #859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a technical module that allows to force a paperformat directly from the report QWeb template definition.
This is useful in situations where the report content is dynamically chosen, depending on some record conditions, and a different paperformat needs to be used for each.
In core, Odoo already allows to overwrite some paperformat values like the
margin-top
,header-spacing
, etc.. through specialdata-report-*
attributes in the roothtml
tag of the report QWeb template. This module extends this feature to allow to overwrite the paperformat itself.In a report QWeb template, set the
data_report_paperformat
variable to the desired paperformatxmlid
.For example: