Odoo Help


4 Answers
Ian Beardslee New Zealand
2/24/13, 6:21 PM

The invoices is actually two parts.

  • The company Header/Footer
  • The invoice content.

Although you can edit the sxw files directly on the file system, we will may end up with different report formats as we move forward supporting different systems. So database config does win to some degree here.

To edit the company Header/Footer I just edited the RML in Settings >> Companies >> <company> >> [edit] >> Header/Footer.

To edit the content, I installed the OpenOffice Report Designer (base_report_designer). This give you an add-on to install for OpenOffice (I use LibreOffice on Ubuntu 12.10) to connect to the database and you can then "Modify An Existing Report". Make your changes and "Send To Server".

I've found that sometimes I can then print an invoice within OpenERP and the changes are visible, other times I have to "Conversion Brackets >> Fields" and then "Conversion Fields >> Brackets" before "Send To Server".

The RML itself lives in ir_act_report_xml.report_rml_content_data.

SISalp France
3/2/13, 4:36 PM

Here is how you can use the report designer, which is a module in OpenERP that allows you to change the look of most documents:


Martin Canada


| 6 6 10
Cornwall, Canada

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin Canada
2/17/13, 8:26 AM

I'm a bit further down the same road. I got as far as generating a new account_print_invoice.rml, and seeing the change I made appear in the invoice pdf.

Unfortunately there are some screw ups. Below I describe how I deal with them.

Here's the steps I follow :

1) back up the two files. Eg,

 cd $OPENERP_PATH/openerp/addons/account/report
 mv account_print_invoice.sxw account_print_invoice.sxw.orig
 mv account_print_invoice.rml account_print_invoice.rml.orig

2) pull the sxw file to my desktop with :

 scp $ME@$REMOTE_HOST:$OPENERP_PATH/openerp/addons/account/report/account_print_invoice.sxw ~/Desktop

3) Open it in LibreOffice and change something visibly, a title for example

4) Save it and push it back to the server with :

scp ~/Desktop/account_print_invoice.sxw $ME@$REMOTE_HOST:$OPENERP_PATH/openerp/addons/account/report

5) Run this command to generate the rml file :

cd $OPENERP_PATH/openerp/addons/account/report
python ../../base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py account_print_invoice.sxw > account_print_invoice.rml

6) Back in OpenERP, Try printing the invoice again. You should see your altered title.

The screw ups

¡Generating an rml file from the originally delivered sxw, does not get you the same rml as delivered! The resulting formatted invoice:

  1. loses it's address information, and
  2. the title section is altered.

Instead of ...

| Description | Invoice Date | Source | Customer Code |

... I get ...

| Description | Invoice Date | Partner Ref. |

Fixes The rml is not hard to read. I found a section entitled "Table_Partner_Address", containing a a macro function display_address(o.partner_id). Putting that into the sxw, regenerating the rml and then regenerating the report, produced the missing address section. This proved to me that macro functions put in the sxw will work with out any further effort in the rml.

tlauber Austria
3/4/13, 7:47 AM

We switched to using JasperReports and set up a quick solution using a webservice delivering the invoice. For more information have a look in the blog section of our homepage (german language).

Ask a Question
Keep Informed
7 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now