Print to PDF instead of ODT

Hi all, I would like to configure Tryton to print reports to PDF instead of downloading ODT files (e.g. sales orders, pick lists, delivery orders, purchase orders, etc.).

I am trying to follow @pokoli’s direction in Odt to pdf while printing?, but when I access the Action Report model (Tryton 6.8), I do not see a “Report Extension” field (I see “extension” and “template_extension” but not “report_extension”). Can anyone help me with this? Am I missing something? Has the name of the field changed?

trytond and modules are installed in a venv on the host (I am not using Docker), and will be installing libreoffice on the host to use headless (the server has no desktop GUI). Tryton users will primarily use the web client (i.e. sao).

Also, from browsing the fields I do see in the Action Report model, it does not seem obvious (at least to me :wink: ) how to enter a field value (“Portable Document Format” per @pokoli ). Some further hints to this regard would also be very much appreciated!

I think that the menu item you are looking for is

Administration → User Interface → Actions → Reports

In the form view of the report you want as .PDF, on the bottom rigt, there is the field “Extension”, where you can choose “Portable Document Format”.

1 Like

Thanks @lars_wuerfel for your help. Unfortunately I do not see “Portable Document Format” as a choice when I accessed the Sale report.

Could I possibly still be looking in the wrong place? Or is it possible PDF is not listed as a selection because libreoffice is not installed yet? (I will install in the morning and check again)

It’s in the ‘Extension’ field not ‘Template Extension’.

1 Like

Yes, LibreOffice has to be installed on the Tryton server, because the conversion to PDF is done with it.

You leave “Template Extension” to “Open Document Text” (this is the source format of the template) and set “Extension” to PDF (see Screenshot).

1 Like

Thanks @lars_wuerfel and @2cadz for pointing out my error! I found I also had to restart trytond, but suspect restarting was required after installing LibreOffice, and not related to changing the Extension to PDF.

I also found I had to create a /home/tryton/.config/libreoffice/ directory (the trytond process is owned by user tryton) or LibreOffice would fail creating a PDF reporting “javaldx failed” and “Fontconfig error: No writable cache directories” errors. Thanks to StackOverflow for the solution (1st answer gives correct cause, but the 6th answer is the “correct” solution)

Cheers and thanks again.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.