Add optional support for weasyprint
When the report is HTML, we could use weasyprint to convert to PDF.
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Cédric Krier added trytond type::feature + 1 deleted label
added trytond type::feature + 1 deleted label
- Author Owner
- Cédric Krier added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Developer
I think #5032 (closed) should be implemented first
- Author Owner
Agreed.
- Developer
Some work have been done by @resteve here:
https://bitbucket.org/trytonspain/trytond-html_report/src/e3dd6df1475dcf564417606ac39e38e1f535cb2f/html_report.py?at=default&fileviewer=file-view-default - Author Owner
It goes in the wrong direction. The HTML rendering should still use Genshi like we already do for email template in web_user.
Indeed the support will be very easy to add if effort is focused on #5032 (closed) instead of creating another engine. Hello,
It would be interesting support different template engine (python, genshi, jinja2...) to render HTML reports.
Example:
class HTMLReport():
render_engine = "genshi" # or a new selection field in ir.action.report
@classmethod
def _engine_genshi(cls, ...):
...
@classmethod
def _engine_jinja2(cls, ...):):
...
In case don't like support jinja2 in core module (only genshi), allow to do with third modules.
Regards,- Developer
@Raimon,
Adding support for other templating engines is a different issue and not related to wsgi print. So feel free to open another discussion for it.
Indeed it can be don in third party modules by overriding the render method of Report. - Author Owner
I'm closing this issue because external module will be allowed to implement extend Report.render or Report.convert thanks to #4735 (closed)
- Cédric Krier added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Cédric Krier closed
closed
- Author Owner
I would like to re-open it because weasyprint is now considered as stable: https://weasyprint.org/news/ and because it probably support better the conversion of html into pdf. So I think it makes sense to have it as extra dependency and use it to convert html into pdf instead of soffice.
- Cédric Krier added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Cédric Krier reopened
reopened
- Developer
Here is review266361002 which adds support for html to pdf conversions
- Sergi Almacellas Abellana assigned to @pokoli
assigned to @pokoli
- Sergi Almacellas Abellana added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
New review266361002 at https://codereview.tryton.org/266361002/#ps270591003
review266361002 updated at https://codereview.tryton.org/266361002/#ps288541002
review266361002 updated at https://codereview.tryton.org/266361002/#ps276511003
review266361002 updated at https://codereview.tryton.org/266361002/#ps258491003
New changeset 3d3d36549669 by Sergi Almacellas Abellana in branch 'default':
Add weasyprint support
https://hg.tryton.org/trytond/rev/3d3d36549669- Roundup Robot added 1 deleted label and removed 1 deleted label
added 1 deleted label and removed 1 deleted label
- Roundup Robot closed
closed
New changeset 2eae884cfb4d by Sergi Almacellas Abellana in branch 'default':
Add weasyprint support
https://hg.tryton.org/tryton-env/rev/2eae884cfb4d