Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How the title states I'm trying to create custom reports with openerp v7.
I have read all the documentation I have found on the subject, and using the base_report_designer module and libreoffice plugin, I can register my custom report all right, using the "Send to server" command of the plugin.
The thing is, I don't want to do that to register my report. I want to register it directly from the code (store it on the server), so that when I update my module containing the report, the report gets registered automatically, without having to pass by all the hassle of using the plug-in and stuff. Because as far as I understand it, registering through the LO plugin, I will have to do it every time I will install my module in an other database.
I also think I will switch to writing directly the rml file later, without using a Writer template.
So that you may have further information, I created a parser for the report, declaring it at the end of the file using the line : report_sxw.report_sxw('report.sale.collection_docket', 'sale.order', 'addons/module/report/collection_docket.rml', parser=order, header="external")
I have declared the report in a report.xml file, with the following tag :
<?xml version="1.0" encoding="utf-8"?>
<report auto="False" id="collection_docket" model="sale.order" name="sale.collection_docket" rml="module/report/collection_docket.rml" string="Collection Docket" />
The report.xml is called in the __openerp__.py file, the __init__.py imports everything all right.
But I never see my report in the Settings/Technical/Actions/Reports, so I can't call it.
The thing I don't really understand so far, is how does it work in the bulit-in openerp addons ? How do they get them to register ? I looked at many examples (in addons/stock for example), and I can't stop a difference with my code. So why can't I get the same result in my custom module ?
Thank you for your help, more or less difficult to work on reports because of the lack of official documentation (the one in odoo website is incomplete, and is aimed at v6.1).
I have the same problem with you. When I check it I use OpenERP 6.1, but I think this behaviour is still persist in OpenERP 7.0. After I dive in the code, I come to conclusion that you can't update rml from module definition by updating the module if the rml already in the database (the module already installed).
I think the issue is because report (sxw/rml) is registered as a service, so the update mechanism is separated from update/init module.
My solution is to update rml content in the database via xmlrpc.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/8/14, 6:13 PM|
|Seen: 742 times|
|Last updated: 3/16/15, 8:10 AM|