Community mailing list archives

community@mail.odoo.com

Report Writer in Odoo (RML, QWeb and other issues)

by
OpusVL, Nuria Arranz-Velazquez
- 03/04/2015 06:45:30

Report Writer in Odoo

When we migrated our old V6.1 Odoo to V8, we had all sort of problems with our Stationary reports, like Invoices.

It was not a straight-forward transition with either RML nor QWeb, and we want to share our experience with the community and learn what is the community experience too, so please do give us your feedback, we’d really appreciate it.

How is Odoo Report Editing at the moment?

At the moment, Odoo is pointing at deprecating RML files and using QWeb views to replace them, and an inbuilt WebKit that will allow the user to do headers and footers in html and css rather than the current RML sitting in the Company Settings screen.

This would be good when we get there, but at the moment there are a number of issues outstanding:

  1. To display your main logo you need to add a system parameter by going to Settings > Technical > Parameters > System Parameters and then create an item with:

    1. Key: report.url

    2. Value: http://your_ip_address_here:and_port

  2. You need to have wkhtmltopdf version 12.1 for the headers and footers to work.

  3. wkhtmltopdf 12.1 is known to have bugs related to pagination that affect headers and footers.

  4. From the UI Odoo forces you to work on original views by:

    1. Not assigning an External ID (which corresponds to the xml_id of the object) to new views.

    2. Not allowing the user to edit/add the External ID on any new view.

  5. Without a xml_id, views cannot be called using the <t-call> tags, which means although you can create new views, you cannot include them in any other views.

  6. To add an xml_id to a new view, the user needs to and access to source code located in the back end files in the addons directory and manually hard-coding an xml_id into them.

    1. This means that a customer without programming knowledge cannot successfully create a report and apply it.

  7. It is possible to alter the layout of a report using the WebBuilder, by changing the type of the view from PDF to HTML and editing it on your browser. Problems:

    1. This will only edit the static content. Any variables needed, like Company Name, Contact Address, etc., need to be added through the view in the Settings options.

    2. Testing is slow and arduous because you are required to change the view type every so often to check that the pdf version works with the changes, at the same time than working on the view itself, and this will only work if you have the correct version of the library and don’t encounter any more bugs with headers and footers.

    3. The HTML editor in the WebBuilder only edits the wrapper of the page, not the content, which means that to use it you would need to copy the xml code from the view in the Settings, paste it in the editor and debug the code before you can start making changes to the report.


In other words: If you want to edit a report you need to pay a software development company fluent in xml and QWeb and familiar with Odoo’s platform and Python, to go into your source code and do the necessary changes.

What is needed?

A way for users to alter / create a report through the UI without having to revert to the back end files in the addons directory.

Potential Solutions

  1. The basic

The way of making this possible with the minimal effort would be:

  1. Automatically assigning xml_id to any new view.

  2. Fixing the wkhtmltopdf known bugs.

  3. Adding to the reporting editing documentation notes about what library version needs to be used and steps to install/upgrade it.

2. WebBuilder Functionality applied to Reports

Create a module that:

  1. Applies the WebBuilder blocks concept to create the layout of the report.

  2. Extend the HTML editor to display the content of the page as well as the outer frame.


3. New Report Designer plugin

Same concept than the old OpenOffice Report Designer, but up to date and able to work with newer versions of OpenOffice AND LibreOffice.

A good example of a report designer is the OpenDoc Mill:

http://troi.org/en/opendoc-mill.html


Community

The purpose of putting this to the community is to report on our findings and find out if this is consistent with what others have found, so:


Have you found the same issues? Please post to the list your experiences.


Also, it's probably worth mentioning that we have created a set of UK friendly sales order and invoice documents and will make available to anyone who wants them through github.

-- 
N. Arranz-Velazquez
OpusVL Odoo Specialist Team (OOST)

OpusVL
Drury House
Drury Lane
Rugby
CV21 3DE

T: 01788 298 450
W: www.opusvl.com