콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2208 화면


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.


아바타
취소
작성자 베스트 답변

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]


아바타
취소