Skip to content
Odoo Migration

Odoo Migration: Managing Custom Report Templates and Print Formats

A practical guide for CIOs and ERP consultants on migrating custom Odoo report templates and print formats. Covers QWeb compatibility, PDF engine changes, testing strategies, and risk mitigation for version upgrades.

7 min readSysGenPro Editorial
Odoo Migration: Managing Custom Report Templates and Print Formats

Direct Answer: How to Manage Custom Report Templates in Odoo Migration

Managing custom report templates and print formats during an Odoo migration requires a structured approach to audit, test, and validate QWeb templates against the target version's rendering engine. The primary risk is that changes in the underlying PDF generation library (such as wkhtmltopdf) or QWeb syntax deprecations can cause visual discrepancies, broken layouts, or complete rendering failures. To mitigate this, organizations must perform a comprehensive inventory of all custom report assets, isolate them in a staging environment, and execute rigorous visual and data reconciliation testing before cutover. This process ensures that critical business documents, such as invoices, purchase orders, and shipping labels, remain accurate and compliant with legal and operational requirements. Failure to address these technical dependencies can lead to significant downtime, manual rework, and loss of customer trust.

Assessment and Inventory of Report Assets

The first step in any Odoo migration is a detailed inventory of all custom report templates. This includes identifying which modules contain custom QWeb templates, which reports are generated via Python code, and which rely on third-party add-ons. CIOs and IT directors should mandate a complete audit of the source environment to map every report action to its corresponding template file. This inventory should document the specific Odoo version, the module dependencies, and any custom CSS or JavaScript embedded within the templates. It is critical to distinguish between standard Odoo reports that may have minor layout changes and highly customized reports that require significant rework. This assessment phase provides the baseline for estimating effort and identifying high-risk areas that require immediate attention.

Identifying Deprecated QWeb Syntax

QWeb, Odoo's templating engine, evolves with each major release. Certain tags, attributes, or expressions may be deprecated or removed in newer versions. For example, changes in how dynamic data is bound or how inheritance works can break existing templates. Developers must review the official Odoo documentation for the target version to identify any breaking changes in QWeb syntax. This includes checking for changes in the report rendering pipeline, such as how headers and footers are handled or how page breaks are managed. By proactively identifying these syntax changes, teams can update templates in the staging environment before the production migration, reducing the risk of runtime errors.

Technical Compatibility and PDF Engine Changes

A significant factor in Odoo report migration is the version of the PDF generation engine, typically wkhtmltopdf. Different versions of wkhtmltopdf handle CSS, fonts, and page layout differently. An upgrade from an older Odoo version to a newer one may involve a jump in the required wkhtmltopdf version, which can alter how complex CSS styles are rendered. For instance, flexbox or grid layouts that worked in an older version might render incorrectly in a newer one. IT teams must verify the compatibility of the target Odoo version with the available wkhtmltopdf versions. This may require updating the server environment or adjusting CSS to ensure consistent rendering. Testing should include a wide range of data scenarios to uncover edge cases where layout breaks occur.

Font and Asset Management

Custom fonts and static assets referenced in report templates must be carefully managed during migration. If templates reference external font files or images, these assets must be preserved and correctly linked in the target environment. Missing assets can lead to fallback fonts being used, which may not meet branding or legal requirements. Additionally, the path to these assets may change depending on the module structure or the Odoo version. Developers should ensure that all asset references are relative or correctly configured in the target environment. This includes verifying that font embedding works correctly in the PDF output, as some versions of wkhtmltopdf handle font subsetting differently.

Staging Environment and Testing Strategy

A representative staging environment is essential for validating report templates before production deployment. This environment should mirror the production hardware, software versions, and data volume. Testing should not be limited to simple 'print and check' scenarios. Instead, it should include automated visual diff testing, where the output of the source and target versions is compared pixel-by-pixel to detect subtle layout changes. Manual testing should focus on complex reports with dynamic data, such as multi-page invoices or detailed shipping labels. Finance leaders and operations managers should be involved in user acceptance testing (UAT) to ensure that the reports meet business requirements and regulatory standards. This collaborative approach helps identify issues that technical teams might overlook.

Data Reconciliation and Accuracy Checks

Beyond visual layout, data accuracy is paramount. Report templates must correctly bind to the underlying data models. During migration, changes in model fields or relationships can cause data to appear incorrectly or be missing. Developers should write unit tests to verify that the data passed to the template matches the expected values. This includes checking for currency formatting, date formats, and tax calculations. Reconciliation checks should be performed against a sample of historical data to ensure that the migrated reports produce the same financial figures as the source system. Any discrepancies must be investigated and resolved before the go-live decision is made.

Cutover Planning and Deployment

The cutover phase for report templates should be integrated into the overall ERP migration plan. This includes scheduling the deployment of updated templates, verifying that the PDF engine is correctly configured, and performing a final smoke test. A rollback plan must be in place in case critical issues are discovered post-deployment. This may involve reverting to the previous Odoo version or using a backup of the report templates. Communication with stakeholders is crucial during this phase. Users should be informed of any changes to report layouts or formats to manage expectations. The go/no-go decision should be based on the results of the testing phase, with clear criteria for what constitutes a critical defect versus a minor cosmetic issue.

Post-Deployment Monitoring and Support

After the migration is complete, continuous monitoring is required to detect any issues that may not have been caught during testing. This includes monitoring the PDF generation logs for errors and tracking user feedback regarding report quality. A dedicated support team should be available to address any urgent issues. Performance metrics, such as the time taken to generate reports, should be monitored to ensure that the migration has not introduced performance regressions. Regular reviews of the report templates should be conducted to identify any further improvements or necessary updates. This ongoing support ensures that the migration delivers long-term value and maintains operational continuity.

Risk Mitigation and Best Practices

To minimize risk, organizations should adopt a phased approach to report migration. Start with low-risk reports and gradually move to high-risk, complex reports. This allows the team to gain confidence in the process and identify common issues early. Documentation is another critical best practice. All changes to report templates should be documented, including the reason for the change, the version of Odoo, and the testing results. This documentation serves as a knowledge base for future migrations and helps new team members understand the report structure. Additionally, regular backups of the report templates and the database should be taken before and after each phase of the migration. These backups provide a safety net in case of unexpected issues.

Risk AreaPotential ImpactMitigation Strategy
QWeb Syntax ChangesBroken templates, runtime errorsAudit templates against target version documentation, update syntax
PDF Engine Version MismatchLayout discrepancies, font issuesVerify wkhtmltopdf compatibility, test with representative data
Data Binding ErrorsIncorrect financial figures, missing dataUnit tests for data binding, reconciliation with historical data
Asset Path ChangesMissing fonts or imagesVerify asset paths, ensure correct linking in target environment
Performance RegressionSlow report generationMonitor performance metrics, optimize templates if necessary

Conclusion

Managing custom report templates and print formats during an Odoo migration is a critical component of a successful ERP upgrade. By following a structured approach that includes thorough assessment, rigorous testing, and careful cutover planning, organizations can mitigate the risks associated with report migration. The key to success lies in attention to detail, collaboration between technical and business teams, and a commitment to quality. As Odoo continues to evolve, staying informed about changes in QWeb and the PDF engine is essential for maintaining the integrity of business reports. By implementing the best practices outlined in this guide, CIOs and ERP consultants can ensure that their organizations are well-prepared for the challenges of Odoo migration and can achieve a smooth transition to the new version.

Written by
SysGenPro Editorial

SysGenPro Editorial

Platform & solutions team

Practical guidance on ERP, AI automation, cloud deployment and enterprise transformation from the SysGenPro team.

Share this article

Frequently asked questions

Common questions on this topic. Talk to our team for anything specific to your business.

01Do Odoo report templates migrate automatically during an upgrade?

No, custom report templates do not migrate automatically in a way that guarantees compatibility. While the files may be copied, the underlying QWeb syntax and PDF engine changes can cause rendering issues. Manual auditing and testing are required to ensure they work correctly in the target version.

02What are the common causes of broken PDF reports after an Odoo upgrade?

Common causes include changes in the wkhtmltopdf version, deprecated QWeb syntax, changes in CSS rendering, and incorrect asset paths. These can lead to layout breaks, missing fonts, or data binding errors.

03How do I test custom report templates before going live?

Use a representative staging environment to perform visual diff testing, manual UAT with business stakeholders, and automated unit tests for data binding. Ensure that the testing covers a wide range of data scenarios to uncover edge cases.

04Can I use the same QWeb templates across different Odoo versions?

Not always. QWeb syntax and the report rendering pipeline can change between major versions. You must verify compatibility with the target version's documentation and update templates as needed.

05What is the role of wkhtmltopdf in Odoo report migration?

wkhtmltopdf is the library used to convert HTML to PDF. Its version significantly impacts how CSS and fonts are rendered. Ensuring the correct version is installed and compatible with the Odoo version is crucial for consistent report output.

06How do I handle custom CSS in Odoo report templates?

Custom CSS should be tested thoroughly in the staging environment. Some CSS properties may render differently in newer versions of wkhtmltopdf. You may need to adjust CSS to ensure consistent layout and styling.

Continue learning
View all articles
Explore the platform

Where to go next

Browse the knowledge hub

See how SysGenPro fits your business

Discuss your workflows, modules and deployment options with our team.

Back to resources