Skip to Content

Implement Dynamic Report Substitution Logic

This enhancement introduces a flexible “Report Substitution” feature. It allows the system to automatically replace a report with a different one based on predefined rules. These rules can include conditions such as which records are being printed or other criteria. This ensures that the correct report layout or version is used automatically without manual selection.
January 4, 2026 by
Implement Dynamic Report Substitution Logic
Silverdale Technology, Somroo Hassaan
| No comments yet

In many real-world business scenarios, a single standard report is not sufficient. Different customers, products, document types, or business conditions may require different report layouts—even though they originate from the same action (for example, printing an invoice, delivery slip, or sales order).

The Dynamic Report Substitution Logic SME introduces a rule-based mechanism that dynamically determines which report should be used at print time.

With this feature, administrators can define Report Substitution Rules that evaluate specific conditions before a report is generated. These rules may include:

  • The model or record being printed (e.g., Sales Orders, Invoices, Pickings)
  • Attributes of the record (customer, product type, warehouse, company, document state, etc.)
  • Custom business logic defined by the organization

When a user prints a document:

  1. Odoo intercepts the standard report request.
  2. The system evaluates the configured substitution rules.
  3. If a rule matches, the original report is automatically replaced with the designated alternative report.
  4. If no rule matches, the system falls back to the default report behavior.

This entire process happens transparently. Users continue to click the same “Print” button, but the system ensures that the most appropriate report is generated behind the scenes.

The logic is fully extensible and does not modify standard Odoo reports, making it upgrade-safe and easy to maintain.

Key Benefits

  • Automation: Eliminates manual report selection by users.
  • Consistency: Ensures the correct report format is always used.
  • Flexibility: Supports multiple layouts for the same document type.
  • Upgrade-Safe: No changes required to standard Odoo reports.
  • Reduced Errors: Prevents printing the wrong report version.

Example Use Case

A company uses different invoice layouts for:

  • Domestic customers
  • International customers
  • Special contractual clients

Instead of training users to choose the correct report manually:

  • The system automatically detects the customer type.
  • The appropriate invoice report is substituted at print time.
  • Users simply click “Print Invoice” as usual.

Another example:

Delivery slips for serialized products use a different layout than non-serialized products. The substitution logic automatically selects the correct report based on product configuration.

Conclusion

The Dynamic Report Substitution Logic SME provides a powerful, rule-driven approach to report management in Odoo. By automatically selecting the correct report based on business conditions, it improves accuracy, reduces user effort, and ensures consistent document output across the organization. This feature is ideal for companies with complex reporting needs that demand flexibility without compromising usability.

Share this post
Sign in to leave a comment