Linux server

This article covers installation process for OpenERP reporting engine on Linux servers. If you find this article useful or want to add some information related to this topic, please feel free to express your opinion on Reporting Engine dedicated forum.

Development project page is located on Launchpad.


Environment dependencies

1.Open ERP server v. 5.x

2.OS: any Linux 32bit or 64bit. (tested on Fedora Core9/11 and Centos5.3 64bit)

Note: Clients can work on all OS systems that support OpenERP.

Note: This module is tested on Windows, and works on this operating system as well. Installation manual yet to be written.

Download: Sources available from launchpad via Bazaar.

Source online:

Download: Packaged module available from KN dati web page.


How to get module

1.Download report_openoffice module through launchpad via Bazaar ( A distributed revision control system ).

# cd /usr/src

# bzr branch lp:report-openoffice

2.Latest version available at download section.

Installation (Dependencies and Base system setup)

System Requirements:

  1. Python 2.4.x or higher (
  2. Relatorio (required v.0.5.1 or higher,
  3. Genshi (
  4. OpenOffice Python
  6. PyYaml

Note: Server does not require “x” windows to be running, in order to run this module.

System Dependencies:

Names of dependencies may differ regarding your Linux distribution.

  1. python-relatorio: A templating library able to output odt and pdf files
  2. python-genshi: Toolkit for stream-based generation of output for the web
  3. PyYAML: YAML parser and emitter for Python
  4. pycairo: Python bindings for the cairo library
  5. pycha (install through python self installer # easy_install pycha, not included in base Centos distribution)
  6. python-openoffice: Python libraries for interacting with
  7. : Python bindings for
  8. v.2.3.x or above.

Report_openoffice module Installation


a)Manually: Copy report_openoffice module to $serverpath/openerp-server/addons/..

b)Through OpenERP interface: Administration -> Modules Management -> Import Module

2.Modify OpenERP launch script (adding python path, important!!!)

# nano /usr/bin/openerp-server

add line before other entries - export PYTHONPATH="/usr/lib64/" #Change to your appropriate OpenOffice path.

File should look like this:

#added for pyuno
export PYTHONPATH="/usr/lib64/" #change this to your OOo path!!!
cd /usr/lib/python2.4/site-packages/openerp-server
exec /usr/bin/python ./ $@

If you prefer to launch server through command line, not modifying launch script, then you must enter in shell this command before launching server:

# export PYTHONPATH="/usr/lib64/"
and then launch server itself
# python ./

Note: in this situation settings will not persist after logout, so you will have to do this every time you log in for particular user before launching server. If you want to save settings, then you must modify openerp-server launch script.

Note: If you don't follow this, you will get error - “importError: No module named pyuno, when installing report_openoffice module or restarting server”.

3.Restart openerp-server

4.Install report_openoffice via Administration-> Modules Management

5.Restart OpenERP server.

If everything went well, system is ready for reports printing.

OpenOffice dependencies for PDF convertion.

Note: These dependencies are required only for converting invoice report to PDF:

  • (required)
  • (required)
  • (required)
  • (required)

Note: Headless OpenOffice below version 3.x. requires package – OpenOffice Headless. Package permits OpenOffice to launch in service mode. If you have OpenOffice 3.x or above, then you don't need to install this package, because in versions 3.x or above OpenOffice Headless is already implemented.

If you get an error message like this:

/usr/lib64/ X11 error: Can't open display:
   Set DISPLAY environment variable, use -display option
   or check permissions of your X-Server
   (See "man X" resp. "man xhost" for details)

...when starting OpenOffice in shell with "-headless" switch - it means that package openoffice-headless is not installed.

Testing OpenOffice headless mode.

To test if OpenOffice is correctly set up, go to OpenOffice installation directory and launch it in headless mode.

# ./soffice -nologo -nofirststartwizard -headless -norestore -invisible "-accept=socket,host=localhost,port=8100,tcpNoDelay=1;urp;" &

Then test with telnet:

# telnet localhost 8100

If you get something like this:

Connected to localhost.localdomain (
Escape character is '^]'.

...then OpenOffice is up and listening to port 8100.

Note: In order to use uno module included in OpenOffice, your OpenOffice distribution must be compiled for the same version of python than you use for Open ERP server.

Configure connection parameters to service

Administration ->Low Level Objects -> OpenOffice Connection

  1. Open wizard;
  2. Fill in your custom values;
  3. Save;

On success you should receive message:"Connection to the instance was successfully established and PDF convertion is working."

If it fails with error : “Connection to instance was not established or convertion to PDF unsuccessful!”

It was unable to connect to or was unable to perform PDF conversion.

Configuring new report object (sample invoice)

  1. Make new object "Administraton->Low level objets->Actions->Report XML -> New;
  2. Create new Report object;
  3. Fill information, for example:
    • Name: Sample Invoice
    • Object: account.invoice
    • Internal name: account.invoice.sample
    • Type: “OpenOffice - odt/ods output” (creates ODT/ODS editable files) or “OpenOffice - pdf output” (creates PDF files)
    • Template path: for example “account/report/invoice.odt”
  4. Save;

Note: It's possible to change to PDF printing by changing printing type to “OpenOffice - pdf output”.<p> <p>For this to work, OOo requires to be started in headless mode.

Adding additional print button (sample invoice)

  1. Administration -> Low Level Objects -> Client actions connections;
  2. Create new Client Action Connection;
  3. Fill information, for example:
    • Name: Sample Invoice
    • Object Name: account.invoice
    • Event Type: client_print_multi
    • Value:,$ID*
  4. Save.

* where $ID is Previously created Sample Invoice object ID number! (can be found at the bottom of GTK client, when Sample Invoice object is opened.)

Now you can open any invoice and try to print with "Sample Invoice" button. Output should be as .odt or .pdf document, depends on what output type you have chosen.

If you can not find additional print button next to Invoice, you may have to restart client application.

Copyright © 2001 Alistek Ltd., ALL RIGHTS RESERVED