Rational
-
From our experience most of the setup are using LibreOffice to generate PDF version of some reports (usually: invoice, sale and delivery note).
But launching LibreOffice each time is quite expensive. On some setup we use a dedicated host on whichtrytond-worker
is mainly responsible of generating PDF. -
The maintenance of OpenDocument (even in flatten) is quite complicated. For some kind of changes we can edit them direct as plain/text (and so back-porting the change is doable) but others are almost impossible without using LibreOffice to edit them. This create a lot of unnecessary changes because the style rules are often renumbering and also different versions of LibreOffice generate different result.
-
Maintaining a coherent style between all the standard report is quite complicated and difficult to enforce.
Proposal
To replace OpenDocument as default report format for standard Tryton report and use HTML with weasyprint.
So relatorio would become an optional dependency and weasyprint a required.
In order to maintain a coherent style, a default set of CSS rules is created by assembling general style rules that each module could define using an ordered and deactivable Model.
This style is included in every report using: <style py:content="style"></style>
.
The user could also add style rules manually.
In standard the general style will be light such that it can be extended easily. For that I think it should follow the BEM convention by providing style for some minimal element like table, headers, address etc.
For the standard HTML part, it should be mainly semantic without any style.
A specific style could be defined on the ir.action.report
the same way as the content is defined (and modified).
As all the reports will be changed, we could extend the standard layout of the module to store all the report template under a sub-directory report
.
Nothing will be planned for the migration. Either users were using the standard reports and so they will be updated to the new standard, either they have custom report content which will stay.