How to Create an XLS Report in Odoo 17 - Odoo 17 Slides
CelineGeorge1
1,101 views
14 slides
Jul 19, 2024
Slide 1 of 14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
About This Presentation
XLSX reports are essential for structured data analysis, customizable presentation, and compatibility across platforms, facilitating efficient decision-making and communication within organizations.
Size: 514.42 KB
Language: en
Added: Jul 19, 2024
Slides: 14 pages
Slide Content
How to Create an XLS Report in Odoo 17 Enterprise
Introduction Enterprise XLSX reports are essential for structured data analysis, customizable presentation, and compatibility across platforms, facilitating efficient decision-making and communication within organizations. In this tutorial, we'll explore how to create XLSX reports in Odoo 17, enabling users to export data from their Odoo system into Excel-compatible files for enhanced analysis or sharing purposes.
Enterprise The XLS report are necessary for every organization It helps easy data manipulation and representation We can create XLS file either in report xlsx base module or through JS file Let’s see by an example
Enterprise Here we trying to create a new XLS report ‘ Invoice Register ’ Which contains the invoice details of a particular date range Let’s move to the pycharm and create a button for printing this report and specify the needed fields in it In button action, we need to specify the return statement
Enterprise
Enterprise In return statement, specify the following data: type : ‘ir.actions.report’ options: it will specify the js encoder representation of data dictionary output_format : you can specify that based on your choice report_format: you can specify that based on your choice model: model for the report Note that, whatever will be the value in output_format should be same as in the controller file And for the report_format, it should be same with js file
Enterprise After the return statement, we need an action manager js file which should be specified in the ‘ static/src/js/action_manager.js’ format Format for action_manager.js will shown in below image Here the report format should be match with the one in the return statement And the url will specify the controller route name
Enterprise
Enterprise In controller, specify the route name as mentioned in the js file Add the output_format same as the one in the return of button And the get_xlsx_report() function will be the name of the python function that contains the complete data needed in XLS file And this function will be added inside the model specified in the return statement
Enterprise
Enterprise In get_xlsx_report(), first specify the io, xlsxwriter and workbook, Don’t forget to import the necessary packages for the proper working After that, specify the merge format, headings etc needed for the report Add the code for extracting the data for the xlsx report
Enterprise
Enterprise After writing the code don’t forget to close the workbook
For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com