Direct Approach to Migrating Custom Odoo Reports and Dashboards
Migrating custom reports and dashboard configurations in Odoo requires a structured approach that prioritizes dependency analysis, code refactoring, and rigorous testing. Unlike standard modules, custom reports often rely on specific data models, security rules, and rendering engines that may change between versions. The primary risk is silent data discrepancies or broken rendering logic that only appears after deployment. To mitigate this, organizations must treat report migration as a distinct workstream within the broader ERP upgrade. This involves mapping every custom report to its underlying data sources, verifying compatibility with the target version's API and schema, and executing parallel testing in a representative staging environment. Success depends on early identification of deprecated features and clear ownership of code changes.
Phase 1: Dependency Analysis and Inventory
Before touching any code, you must create a comprehensive inventory of all custom reports and dashboards. This includes identifying the module names, the specific XML templates used, any custom Python controllers, and the data models they query. Use Odoo's module dependency graph to understand which standard modules these custom reports depend on. If a custom report depends on a module that is being replaced or significantly altered in the target version, this is a critical risk. Document the business purpose of each report to determine if it can be replaced by a standard feature in the new version, which often reduces technical debt.
Identifying Deprecated APIs and Models
Review the official Odoo release notes for the target version to identify deprecated fields, methods, or models. Custom reports often use direct SQL queries or ORM calls that may break if the underlying database schema changes. For example, if a field is renamed or its data type changes, the report will fail or produce incorrect data. Verify compatibility against the vendor's official documentation for the exact source and target versions. Do not assume that a report will work if the module loads; you must verify the output data accuracy.
Phase 2: Code Refactoring and Compatibility Checks
Once dependencies are mapped, begin refactoring custom code. This often involves updating XML templates to match new QWeb syntax or adjusting Python code to use new API methods. Pay close attention to security rules. If a report is accessible to specific user groups, ensure that the security rules in the target version still apply correctly. A common issue is that reports become visible to users who should not have access, or vice versa, due to changes in how access rights are evaluated. Refactor any direct database access to use the ORM where possible, as this provides better abstraction and future-proofing.
Handling View Inheritance and Layout Changes
Custom dashboards often use view inheritance to modify standard views. If the standard view structure changes in the new version, the inherited views may break or display incorrectly. Test these layouts thoroughly in a staging environment. Ensure that responsive design and mobile views are also validated, as many modern ERP upgrades include significant UI/UX changes. If a dashboard relies on third-party widgets or libraries, verify that these libraries are compatible with the new Odoo version's JavaScript framework.
Phase 3: Staging Environment Testing Strategy
A representative staging environment is non-negotiable for report migration. The staging database should contain a subset of production data that covers all edge cases, including large datasets, special characters, and multi-currency scenarios. Run the custom reports in the staging environment and compare the output with the production environment. This reconciliation step is critical to catch data discrepancies. Use automated testing scripts where possible to validate that report totals match the source data. Manual testing should focus on visual layout, user permissions, and export functionality (PDF, Excel, CSV).
| Test Type | Focus Area | Success Criteria |
|---|
| Data Accuracy | Compare report totals with source data | 100% match in financial figures |
| Security | Verify access rights for different user groups | No unauthorized access; correct visibility |
| Performance | Measure report generation time | No significant regression vs. baseline |
| Export | Test PDF, Excel, and CSV exports | Files open correctly with no formatting errors |
Phase 4: Cutover and Deployment Planning
Plan the cutover window carefully. Report migration is often part of a larger module upgrade, so coordinate with the team handling core modules. Ensure that all custom report modules are included in the upgrade script. Perform a final backup of the production database before the upgrade. During the cutover, monitor the upgrade logs for any errors related to report modules. If an error occurs, have a rollback plan ready. The rollback should restore the previous database backup and revert any code changes. Communicate the downtime window to all stakeholders, especially finance and operations teams who rely on these reports for daily decision-making.
Go/No-Go Criteria