Odoo
Implementation
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 417 |
| Technical Name |
xlsx_report |
| License | OPL-1 |
| Website | https://lucidbrainz.com/?i=1 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 417 |
| Technical Name |
xlsx_report |
| License | OPL-1 |
| Website | https://lucidbrainz.com/?i=1 |
Base Report XLSX - Excel Report Generator
Professional XLSX (Excel) Report Generation System - Create Beautiful Excel Reports with Custom Formatting, Multiple Worksheets, and Advanced Features for Any Odoo Model in Odoo 19
Module Overview
Base Report XLSX by Lucidbrainz Infotech is a powerful foundation module for Odoo 19 that enables developers and businesses to create professional Excel (XLSX) reports from any Odoo model with advanced formatting capabilities, multiple worksheet support, and custom styling options. This module serves as the base framework for building sophisticated Excel-based reporting solutions including financial reports, inventory analysis, sales reports, purchase orders, accounting statements, data exports, and any custom business intelligence reports. Built on the robust xlsxwriter Python library, the module provides seamless integration with Odoo's reporting framework and offers developer-friendly abstract base classes for easy extension. Perfect for businesses requiring professional data presentation, accountants needing formatted financial statements, managers wanting analytical reports, developers building custom reporting solutions, and organizations migrating from Excel-based workflows to Odoo. The module features automatic report generation from UI, support for bold text, colors, borders, and formulas, intelligent duplicate worksheet name handling (auto-increment ~01, ~02, etc.), currency formatting with symbol position support, multiple worksheet creation, BytesIO streaming for efficient memory usage, JavaScript integration for seamless download experience, attachment save functionality, context and data parameter support, wizard-based report generation, multi-record batch processing, and clean Odoo 19 architecture compliance. The included example Partner XLSX report demonstrates implementation with easy-to-follow code patterns. Built with minimal core customization using model inheritance, ensuring compatibility with other modules and easy version upgrades. Technical features include abstract model inheritance pattern, xlsxwriter workbook customization options, HTTP controller for report routing, JSON data handling, proper error handling with logging, content-disposition header management, base64 encoding support, and developer-friendly API. Ideal for creating financial statements, balance sheets, profit & loss reports, trial balances, tax reports, inventory valuations, stock movement reports, sales analysis, purchase analysis, customer aging reports, vendor aging reports, product catalogs, price lists, commission reports, payroll sheets, and any custom business reports requiring Excel format!
Complete Features & Capabilities
- XLSX Report Generation: Create professional Excel files in standard .xlsx format compatible with Microsoft Excel, LibreOffice Calc, Google Sheets, and all modern spreadsheet applications
- Abstract Base Class: Developer-friendly report.xlsx_report.abstract model provides clean inheritance pattern for creating custom XLSX reports with minimal code
- xlsxwriter Library Integration: Powered by industry-standard xlsxwriter Python library offering full Excel formatting capabilities including fonts, colors, borders, formulas, charts
- Multiple Worksheet Support: Create reports with unlimited worksheets (tabs) for organizing complex data into logical sections and categories
- Smart Duplicate Sheet Naming: Patched xlsxwriter workbook automatically handles duplicate worksheet names with auto-increment sequence (~01, ~02, ~03) up to 100 duplicates
- Advanced Cell Formatting: Apply bold, italic, underline, font size, font color, background color, borders, alignment, number formats to any cell
- Currency Formatting Helper: Built-in _xlsx_report_currency_format() method generates proper Excel currency format strings with symbol position support (before/after)
- Excel Formula Support: Write native Excel formulas (SUM, AVERAGE, IF, VLOOKUP, etc.) that calculate dynamically when users open the file
- Seamless UI Integration: Reports appear in Odoo Print menu with one-click download - JavaScript handler manages entire download process with UI blocking
- HTTP Controller Integration: Custom ReportController extends Odoo base controller to handle /report/xlsx/ routes with proper content-type headers
- Flexible Data Retrieval: _get_objs_for_report() method intelligently fetches records from docids, context active_ids, or wizard data
- Multi-Record Processing: Generate reports for single records or batch process multiple selected records with comma-separated IDs
- Workbook Customization Options: Override get_workbook_options() to pass custom xlsxwriter Workbook() constructor options for specialized features
- BytesIO Streaming: Efficient in-memory workbook generation using BytesIO without temporary file creation - better performance and security
- Attachment Save Support: Optional automatic saving of generated reports as ir.attachment records for archival, audit trails, email attachments
- Context & Data Parameters: Pass context variables and custom data dictionaries to reports for dynamic filtering, grouping, and customization
- Wizard Integration: Perfect for wizard-driven reports where users select date ranges, filters, groupings before generating Excel output
- Error Handling & Logging: Comprehensive try-catch blocks with _logger integration and user-friendly error messages for debugging
- Performance Optimized: Minimal overhead with efficient algorithms - generates large reports quickly without impacting server performance
- Dynamic Filename Generation: Use safe_eval() with print_report_name field to create contextual filenames like "Invoice_INV001.xlsx" or "Report_2025-01-15.xlsx"
- Example Implementation: Included Partner XLSX report (report.xlsx_report.partner_xlsx) demonstrates complete implementation pattern with working code
- Clean Odoo Architecture: Follows Odoo 19 best practices using model inheritance, proper XML declarations, and standard controller patterns
- No Module Conflicts: Minimal core modifications ensure compatibility with all standard and third-party Odoo modules
- Easy Extension Pattern: Simply inherit abstract model, implement generate_xlsx_report() method, add report XML declaration - done!
- Well Documented Code: Comprehensive docstrings, inline comments, and clear method names for developer understanding and customization
- Multi-Company Support: Full Odoo 19 multi-company architecture compatibility with company-specific report configurations
- Responsive UI: Report generation works seamlessly on desktop, mobile, and tablet interfaces with proper download handling
- Production Ready: Mature module with stable codebase, used by thousands of Odoo installations worldwide for critical reporting needs
- Community Backed: Based on OCA (Odoo Community Association) reporting-engine module with extensive community testing and contributions
Live Module Screenshots - Odoo 19
Settings → Technical → Actions → Reports → "Print to XLSX":
• Action Name: Print to XLSX
• Model Name: res.partner (Contact/Partner model)
• Report Type: XLSX (Excel format)
• Template Name: xlsx_report.partner_xlsx
This view shows how XLSX reports are registered in Odoo's reporting system with proper configuration
Detailed report configuration showing all settings:
• Action Name: Print to XLSX
• Report Type: XLSX option selected
• Model Name: res.partner
• Template Name: xlsx_report.partner_xlsx (Python class reference)
• Visibility Tab: Access rights and privilege management
• Advanced Properties: Additional report configurations
• Add to Print Menu: Quick action to make report accessible from UI
This form demonstrates how easy it is to configure custom XLSX reports in Odoo 19
How It Works - Simple 3-Step Implementation
Create Report Class
Inherit from report.xlsx_report.abstract → Implement generate_xlsx_report() method → Add your Excel generation logic with xlsxwriter
Define Report XML
Create ir.actions.report record → Set report_type="xlsx" → Link to your model → Reference your Python class name
Generate Reports
Users select records → Click Print → Choose your XLSX report → Excel file downloads automatically with all your custom formatting!
Our Professional Services
Odoo
Customization
Odoo
Migration
Support &
Maintenance
📞 Contact Us
WhatsApp:
Email:
Website: |
🌐 Follow Us📘 Facebook 📸 Instagram 💼 LinkedIn 🎥 YouTube |
© 2025 Lucidbrainz Infotech | Professional Odoo 19 Solutions | All Rights Reserved
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module