It has been a while since I wrote my most recent blog post. I had a business trip last month to discuss some requirements. In the meeting, an accountant guy told me that there is a (huge) need to print out Accounting Reports under Excel format. As far as I know, from a technical guy’s view, those reports are supported differently in different versions of Odoo, as well as in some OCA modules.
A couple of years ago, I worked with Odoo 7, it used RML as a standard report engine. But at that time, my team used the Aeroo Report solution from Alistek. It was easy to define visually the report templates in OpenOffice Writer, Calculation files which are equivalent to Microsoft World, Excel files. It worked perfectly for small simple report with a few pages, but for larger reports, especially Excel, with hundreds or thousands of lines, it caused performance issues. So we picked another solution for Excel report using xls_report (supports XLS) or xlsx_report (supports XLSX) . Although we had to define the template directly in Python code, it was much more faster.
Since the release of Odoo 8, there have been more powerful report engines such as Webkit Report Engine, it supports reports designed in HTML and CSS, then render them in PDF format using WebKit library (wkhtmltopdf). There is also another report engine called QWeb Reports. I was confused these two engines because I thought they are very similar to each other, why should I have two? Antony Lesuisse clarified it in this mail thread. ‘The qweb report engine is actually a webkit report engine. Both module use industry standard HTML/CSS and wkhtmltopdf to generate a pdf version. The only difference is that report_webkit uses jinja for dynamic expressions whereas report_qweb uses qweb. The main advantage of qweb syntax is that it is based on xml so you can easily apply the odoo xpath extension mechanism. Also headers are not hardcoded any template can call any other template, headers are simply templates that are called by most of the templates.’ - said Antony. In another blog post, I also talked about the inheritance in QWeb that help reuse the designs. By the way, there is another good article from Serpentcs comparing the RML and Webkit.
Let’s go back to the topic Accounting XLS Reports for Odoo. I found some promising modules from the community.
account_financial_report_aeroo_xls: as I said before, I do not want to try this right now due to performance issues I mentioned above. I don’t know if it’s fixed or not. You can try and let me know later.
account_financial_report_webkit_xls: it depends on module account_financial_report_webkit, the library wkhtmltopdf and module report_xls. They add or replace the following standard OpenERP financial reports: General Ledger, Trial Balance, Partner Ledger, Partner Balance, Open Invoices Report, Aged Partner Balance.
controller_report_xls: it gives the possibility to export QWeb reports into XLS format.
Now I am going to try the module account_financial_report_webkit_xls. After installing it and all related modules, libraries. Beside the button Print to export the report to PDF format, now I have a new button Export to export as XLS format.
I created another database to test the module controller_report_xls. This module just provides some python classes and library to convert the QWeb template into XLS format. I did not have much time to prepare a button and pass a parameter to the context so I simply commented out the if-condition in the file controller_report_xls > controllers > main.py to test.
Then I print them out, the format was not really nice. Anyway, it is good to know the approach of this module.
In short, we have several ways to handle the Accounting XLS Reports in Odoo 8. From my perspective, I think the best option so far would be the module report_xls / xlsx_report. Module account_financial_report_webkit_xls basically is built based on report_xls, check its code and you will see.
However, you may know that if we use Odoo 9 / 10 Enterprise, XLS reports are supported by default, plus we have a very cool feature Dynamic Reports. I spent time on this post because my project is recently running on a mix of Odoo 8 and 9 Community edition, I am not sure that my team can integrate those modules. Anyway I will suggest all possible solutions above to my clients and my team, then we will find the best approach for our project.