Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Nov 17, 2018

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

@hbrunn hbrunn added this to the 12.0 milestone Nov 17, 2018
@hbrunn hbrunn force-pushed the 12.0-report_qweb_weasyprint_renderer branch 3 times, most recently from bab77c2 to 94e9c81 Compare November 18, 2018 04:57
@JordiBForgeFlow
Copy link
Member

Interesting! cc @etobella @ageficent

Copy link

@elicoidal elicoidal left a 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')],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking: Weasyprint?

Copy link

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",

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weasyprint

Copy link
Member

@bealdav bealdav left a 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

Copy link

@NL66278 NL66278 left a 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.

Copy link
Member

@etobella etobella left a 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.

@hbrunn
Copy link
Member Author

hbrunn commented Jun 10, 2019

@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.

@etobella
Copy link
Member

Then it worked as expected 😄

@bealdav
Copy link
Member

bealdav commented Aug 28, 2019

While webkit is broken according to versions
see camptocamp/docker-odoo-project#115
weasyprint engine works.

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

@hbrunn
Copy link
Member Author

hbrunn commented Aug 28, 2019

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

@bealdav
Copy link
Member

bealdav commented Aug 30, 2019

ok @hbrunn thanks for your info.

@hbrunn
Copy link
Member Author

hbrunn commented Aug 30, 2019

of course, anybody else is cordially invited to finish it too :-)

@hbrunn hbrunn force-pushed the 12.0-report_qweb_weasyprint_renderer branch from a539e4c to 0d790b1 Compare September 22, 2019 21:37
@bhaveshselarka
Copy link

@hbrunn @elicoidal

@github-actions
Copy link

github-actions bot commented Mar 6, 2022

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 6, 2022
@github-actions github-actions bot closed this Apr 10, 2022
@maisim
Copy link

maisim commented May 18, 2022

@hbrunn @elicoidal @etobella @bealdav
Hello, it would be nice to merge this work, I thought I would do the same and I find it already done!

@hbrunn
Copy link
Member Author

hbrunn commented May 18, 2022

feel free to take over whatever you can use here, I won't be continuing this any time soon

@maisim
Copy link

maisim commented May 18, 2022

Ok, thanks for the work you have done!

@litmount
Copy link

@hbrunn @elicoidal @etobella @bealdav Hello, it would be nice to merge this work, I thought I would do the same and I find it already done!

Hello @maisim , Did you make any progress on this? It would be nice to have weasyprint as an option in Odoo.

@maisim
Copy link

maisim commented Sep 26, 2022

Hi @litmount
not yet, hopefully in the next few weeks

@litmount
Copy link

Hi @litmount not yet, hopefully in the next few weeks

@maisim Great! What version of Odoo are you working on this for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.