Is there a module or a way to define the font size of qweb report dynamically for example on the configuration without change it on the code?
1
votes
1 Answers
1
votes
You can create a field (or fields) on the res.company
module to define font_size
or any other features you want and then call them from QWeb this:
# Field can be Integer or Float
<p t-attf-style="font-size: #{o.company_id and o.company_id.font_size or '12'}px;">
# Field can be Char, but is more prone to possible user input error
<p t-attf-style="font-size: #{o.company_id and o.company_id.font_size or '12px'};">
Of course, this requires that whatever model your report is for must have a company_id
field to pull from. However, most models have this already, so it is a fairly safe assumption.
This technique isn't really noted anywhere in the documentation, but I'll link to it anyway.