Odoo Help

Welcome!

This community 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.

1

Change report in a custom module?

By
Bonnet Denis
on 5/23/13, 7:17 AM 2,705 views

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

1

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 5/23/13, 7:48 AM

Hi,

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})   
report_sxw.report_sxw('report.purchase.order2','purchase.order','addons/my_module/report/order.rml',parser=order)

4° -create file report/purchase_report.xml

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

you can use openerp interface and not code :

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

Thanks.

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

Borni DHIFI
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'.

Borni DHIFI
on 5/23/13, 12:15 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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