XLS reports are often necessary for many business organizations. Data representation and manipulation can be done in XLS file very easily. In this blog, we will be discussing ‘how to create XLs report in Odoo.’ You know by default Odoo doesn’t’ support XLS file creation of a report.
2. INTRODUCTION
XLS reports are often necessary for many business organizations. Data representation and
manipulation can be done in XLS file very easily. In this blog, we will be discussing ‘how to create XLs
report in Odoo.’ You know by default Odoo doesn’t’ support XLS file creation of a report. So you an
extra module ‘report_xls’ and you can download it from here.
Link: https://www.odoo.com/apps/modules/9.0/report_xlsx/
3. Here we are going to create an XLS report from a wizard. Wizard can be used to
enter the data and based on this data we can filter the report. In the wizard,
we will add some fields to filter the content of the report. So let us first look
how the wizard is created.
5. This is the python file created for the wizard. Here the fields start_date, end_date, and sales_person are
filtration fields. The data in the wizard can be filtered according to the value in the fields
XML File:
Wizard view:
<record id="view_crm_won_lost_report" model="ir.ui.view">
6. This is the code for the view of the wizard (or the design of the wizard). In this view, the
user can enter the filter details such as date and the salesperson. After selecting the
required fields, the user can click the ‘print report’ button to print the ‘Xls’ report. When
the user clicks the print button, the call goes to ‘print_xls_report’ function defined in the
given model
7. def print_xls_report(self, cr, uid, ids, context=None):
In the next step, we have to define the report in the name ‘report_crm_won_lost_report’
from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx
• In the above code, we have to write the last line properly. It should be like this
Classname('report.module_name.report_name.xlsx', 'model_name')
8. • Now we can load the report to the database. For that, we have to add a report tag in XML,
<report
This is developed in the version 9. You can follow similar steps in v8 and in v10. According to the version,
we have to change the version of the ‘report_xlsz’. It can be downloaded from Odoo apps.
9. We already have uploaded a module using above code in the app store, you can
check and use it for reference along with this blog.
10. Refer this link for more:
https://www.cybrosys.com/blog/how-to-create-a-xls-report-in-odoo
11. Thank You !
Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park,
Kakkancherry,
Calicut University P.O.
Calicut
Kerala, India - 673635.
Cybrosys Ltd
15, ST Antonys Road,
Forest Gate, London
England,
E79QA.
Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, Kerala,
India-682030.