-
-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] report_qweb_weasyprint_renderer #256
Conversation
bab77c2
to
94e9c81
Compare
Interesting! cc @etobella @ageficent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
_inherit = 'ir.actions.report' | ||
|
||
qweb_pdf_engine = fields.Selection( | ||
selection_add=[('weasyprint', 'weasyprint')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking: Weasyprint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitty nitpicking: WeasyPrint? ... https://github.com/Kozea/WeasyPrint
"author": "Therp BV,Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"category": "Reporting", | ||
"summary": "Use weasyprint to create PDFs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weasyprint
</html> | ||
</template> | ||
<report id="demo_report" | ||
string="weasyprint demo report" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weasyprint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested, it works even if runbot is red
Thanks a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me. Nice separation between the general concept of having rendering engines and the weasyprint stuff. Nitpick: we should no longer have copyright lines in init.py files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works, but it is not currently showing correctly the headers and footers. I don't know if it is something that I made wrongly or it is the behaviour. I used the runbot and changed the Preview External Report and It was not showing correctly the footer / headers.
@etobella this is not a drop in replacement for existing wkhtmltopdf reports (yet), so for testing this, you should use the demo report included here and extend this. I just did some new experiments, headers and footers work now both with CSS and as fixed position elements, but in the latter case we don't have counters, in the former case no elements, so it's not yet perfect. |
Then it worked as expected 😄 |
While webkit is broken according to versions Slowly but works Then at least, as fallback report engine, this feature should considered as required in our customer projects and PR merge encouraged. Thanks |
what's missing here is time to finish Kozea/WeasyPrint#882 (=support counters and strings in margin boxes in weasyprint), when this is done, it should be doable to add some CSS magic to use this as dropin replacement for wkhtmltopdf |
ok @hbrunn thanks for your info. |
of course, anybody else is cordially invited to finish it too :-) |
a539e4c
to
0d790b1
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
@hbrunn @elicoidal @etobella @bealdav |
feel free to take over whatever you can use here, I won't be continuing this any time soon |
Ok, thanks for the work you have done! |
Hello @maisim , Did you make any progress on this? It would be nice to have weasyprint as an option in Odoo. |
Hi @litmount |
This refers to discussion #254
For testing this, go to the list view of addons and print the weasyprint demo report.
To make it possible to replace wkhtmltopdf, we'll probably need to implement box-decoration-break in weasyprint