On Wednesday, July 18, 2018 at 8:30:06 PM UTC+5, Cédric Krier wrote:
> On 2018-07-18 13:07, Khurram Shahzad wrote:
> > Can I generate reports in PDF format in Tryton?
>
> Yes, you need to have 'soffice' installed (from LibreOffice or
> OpenOffice) and you must set the extension of the ir.action.report to
> 'pdf'.
I am working on it and will share the update soon.
>
> > If not possible (or very difficult), can I render the PDF file as a report.
> > I am able to call a an HTTP Service to get the generated PDF file (as
> > stream) but can not show it as a report from Report Menu.
>
> You can override the method 'render' of your Report class. It must
> return the bytes of file that you have generated.
>
Thank you so much. I was able to successfully display the PDF file received from a network service using Report menu. However, I had to add MIMETYPE for PDF in report.py ('pdf': 'application/pdf'). Otherwise, it throws an Exception in the convert method being 'No Such file ..'.