Skip to Content
Menu
This question has been flagged
1 Reply
1815 Views


I'm trying to add a module to odoo to integrate it with other in-house custom software.

For that I would like the user to click a button in odoo that generates a pdf report. However instead of presenting it to the user for download, it should be passed to another program server side already.

I understand how to add a button on the odoo interface and how to generate reports. What I'm missing is a way to access that pdf report from inside the python code of an odoo module instead of downloading it client side.

Is there an odoo api call for that ?

Thank you.


Avatar
Discard
Author Best Answer

Digging in the existing odoo code base I found the IrActionsReport model exposes a member function render_qweb_pdf. That turns out to do exactly what I need.

I can use it as follows:

<something>.env.ref('<my_report').render_qweb_pdf(res_ids=<my-model-ids>, data=<my-extra-data>)[0]


Avatar
Discard