Odoo Help


Change report in a custom module?

Bonnet Denis
on 5/23/13, 7:17 AM 3,206 views

How can I change the quotation report without changing the rml file in sale module(same question for invoice report)?

On 5/23/13, 7:48 AM


it is the same principle that views and fields : overwrite report.

For example i edited a report purchase in my custom module :

1° - create folder my_module/report

2°- copy files .rml and .swx in this folder

3°- create file report/order.py

 class order(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(order, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({'time': time})   

4° -create file report/purchase_report.xml

<?xml version="1.0" encoding="utf-8"?>
        <report auto="False" id="report_purchase_order" model="purchase.order"
                name="purchase.order" rml="my_module/report/order.rml"
                usage="default" string="Purchase Order"/>

you can use openerp interface and not code :

Settings>>Technical>>Reports and duplicate report then edit this report to openOffice.


your class and/or your report tag doesn't seems to inherit some existing object. Where do you say which report you want to extend/replace?

Bonnet Denis
on 5/23/13, 8:04 AM

ah oky , it create a duplicate report Purchase Order. you can delete old report in Settings--Technical--Reports then The new report will be used

on 5/23/13, 8:27 AM

Thanks a lot, but if I update the server, will my personal report be still in place INSTEAD OF the original?

Bonnet Denis
on 5/23/13, 12:02 PM

So if you want see a original rml juste change the field Report File ='my_module/report/order.rml' in Settings--Technical--Actions--Reports to path original file rml 'purchase/report/order.rml'.

on 5/23/13, 12:15 PM

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

Question tools

0 follower(s)


Asked: 5/23/13, 7:17 AM
Seen: 3206 times
Last updated: 3/16/15, 8:10 AM