Creating custom reports in Odoo 8


1. Creating a new XML file

This file should be placed under yourModuleName/views and you can name it as you wish.

 

11

vetclinic_animal_report.xml

55


eg. of Minimal viable template

 

Capture

2. Add the report to the XML file responsible for reports

22

report.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<openerp>
<data>

<report
id=”action_report_vetclinic”
model=”vetclinic.animal”
string=”VetClinic Details”
report_type=”qweb-pdf”
name=”vetclinic.vetclinic_animal_report”
file=”vetclinic.vetclinic_animal_report”
/>

</data>
</openerp>

3. Notify Odoo from the new report

33

__openerp__.py

{
‘name’: ‘Vet Clinic’,
‘version’: ‘1.0’,
‘description’:’Vet Clinic application for Animals’,
‘author’: ‘ananthu’,
‘website’: ‘http://www.codersfort.com&#8217;,
‘depends’: [‘base_setup’],
‘data’: [
‘vetclinic_view.xml’,
‘report.xml’,
‘views/vetclinic_animal_report.xml’
],
‘demo’:[],
‘installable’:True,
‘auto_install’: False,
}

4. Wrapping things up

44

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s