Posted On

Just like any modern report design tool, Eclipse BIRT features easy-to-use drag-and-drop capability to create point-perfect report in a very short turnaround time. You can create one design but target multiple output formats, such as PDF and Excel, at the same time.

It supports custom event handler, a very powerful scripting capability to customize almost every aspect of report creation using Javascript or Java.

In this post, I will show you how to replace the default purchase order report with one that I designed in Eclipse BIRT.

I recommend you check out my first post Odoo BIRT Connector and try out the prebuilt Docker images.

Alternatively, you can setup Jetty on your host machine by following the steps in the Dockerfile.

It is important to note that you must use raw SQL to prepare the data sources. It does not (at least at the moment) support XMLRPC. What this means is that you must understand the underlying data models and their relationships in order to create a proper, meaningful report.

You might also need to duplicate computations in SQL if your model uses function field, or do it inside the report using expression in dynamic text field.

Before we continue, please install the Purchase Management addon:

Below is the default purchase order report supplied by Odoo. I am going to replace this with my report. The rptdesign file is available here.

You can inspect the rtpdesign with Eclipse BIRT, or any text editor because rptdesign file is essential an XML file. rptlibrary on the other hand, is the way BIRT uses to share common resources (JDBC connections, styles, images and etc) with rptdesign files.

How to Setup a BIRT Report in Odoo

Extract and copy both rptlibrary and rptdesign files into the reports data volume referenced by your birtconn container (eg. birt-demo/extras/birtconn/reports).

Next, create the following 3 items:

Item 1: Report Action

1. Service Name must begin with the prefix birt. so Odoo will pass it to our report generator.
2. Object must be report_birt.report_wizard
3. Report File is the name of the .rptdesign file. In this case, purchase_order.rptdesign
4. Note the ID. We will need it later.

Item 2: Window Action

1. Object Name must be report_birt.report_wizard, just like above.
2. Context Value should contain the report_name=[Service Name] key/value pair.

Item 3: Action Binding

1. Model Name is the model name this report will be made available for.
2. Action Reference must be a string in the form of ir.actions.report.xml,[ID from item 1.4]
3. Qualifier must be client_print_multi if the .rptdesign supports printing multiple reports in a single file.

That's it! The design supports printing single or multiple records in a single PDF. It works just like the default report, except prettier.

Compare this following with the default purchase order report.

This is another report with a different set of demo data.

I am constantly improving this module, and v8 port should be just around the corner. If you have any thoughts, let me know. In the meantime, I am leaving you with the following links: