Tryton - Issues

 

Issue5964

Title Add optional support for weasyprint
Priority feature Status resolved
Superseder Add pluggable report converter
View: 5032
Nosy List ced, pokoli, resteve, reviewbot, roundup-bot
Type feature request Components trytond
Assigned To pokoli Keywords review
Reviews 266361002
View: 266361002

Created on 2016-10-20.18:28:22 by ced, last changed by roundup-bot.

Messages
New changeset 2eae884cfb4d by Sergi Almacellas Abellana in branch 'default':
Add weasyprint support
https://hg.tryton.org/tryton-env/rev/2eae884cfb4d
New changeset 3d3d36549669 by Sergi Almacellas Abellana in branch 'default':
Add weasyprint support
https://hg.tryton.org/trytond/rev/3d3d36549669
review266361002 updated at https://codereview.tryton.org/266361002/#ps258491003
review266361002 updated at https://codereview.tryton.org/266361002/#ps276511003
review266361002 updated at https://codereview.tryton.org/266361002/#ps288541002
New review266361002 at https://codereview.tryton.org/266361002/#ps270591003
msg53352 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2019-11-20.12:29:56
Here is review266361002 which adds support for html to pdf conversions
msg44870 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-11-13.13:23:41
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.
msg37474 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-12-28.18:49:15
I'm closing this issue because external module will be allowed to implement extend Report.render or Report.convert thanks to issue4735
msg33464 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-04-27.14:10:21
@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.
msg33463 (view) Author: [hidden] (resteve) Date: 2017-04-27.13:09:14
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,
msg33462 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-04-27.12:35:56
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 issue5032 instead of creating another engine.
msg33461 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-04-27.12:28:32
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
msg31865 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-02-10.14:53:46
Agreed.
msg31863 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-02-10.13:31:48
I think issue5032 should be implemented first
msg29543 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2016-10-20.18:28:38
http://weasyprint.org/
msg29542 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2016-10-20.18:28:21
When the report is HTML, we could use weasyprint to convert to PDF.
History
Date User Action Args
2019-12-03 18:42:05roundup-botsetmessages: + msg53811
2019-12-03 18:41:58roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg53810
2019-12-01 22:35:16reviewbotsetmessages: + msg53772
2019-11-29 15:43:29reviewbotsetmessages: + msg53740
2019-11-21 00:04:33reviewbotsetmessages: + msg53368
2019-11-20 12:39:56reviewbotsetnosy: + reviewbot
messages: + msg53353
2019-11-20 12:39:55reviewbotsetreviews: 266361002
keyword: + review
2019-11-20 12:29:56pokolisetstatus: chatting -> testing
assignedto: pokoli
messages: + msg53352
2018-11-13 13:23:41cedsetstatus: invalid -> chatting
messages: + msg44870
2017-12-28 18:49:15cedsetstatus: chatting -> invalid
messages: + msg37474

Showing 10 items. Show all history (warning: this could be VERY long)