| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 116 |
| Technical Name |
odoocraft_report_domain |
| License | AGPL-3 |
| Versions | 14.0 15.0 16.0 17.0 |
OdooCraft Report Domain
Control which reports appear based on record data — show the right report to the right user, always.
Odoo 17 Community Edition Domain FilteringThe Problem
In Odoo, all bound reports appear in the print menu regardless of whether they make sense for the current record. A "Draft Invoice" report shows up on paid invoices. A "Product Label" report appears on services. Users get confused, mistakes happen.
There is no built-in way in Odoo 17 to restrict report visibility based on record state, type, or any other field. Until now.
The Solution
This module adds a Filter Domain field to every report action. When set, the report only appears in the print menu if the current record matches the domain. If no domain is set, the report behaves exactly as before — zero disruption.
Domain-Based Visibility
Set any Odoo domain expression on a report. It only shows when the record matches.
User Context Support
Reference user inside the domain to create user-specific report rules.
Zero Configuration
Install and go. Reports without a domain are unaffected. No migration needed.
Visual Domain Builder
Uses Odoo's native domain widget — no manual JSON needed, just pick fields and rules.
How It Works
When a user opens the print menu on a record, the module calls the server to check which reports pass their configured domain against the current record(s). Only matching reports are rendered in the menu — the rest are silently hidden.
-
Go to Technical → Actions → Reports
Open any report you want to filter. -
Set the Filter Domain
Use the visual domain builder to define when this report should be visible. Example: only show on confirmed sales orders. -
Save and test
Open a record that matches — the report appears. Open one that doesn't — it's gone. Clean and automatic.
Domain Examples
Only show report on confirmed sales orders:
[('state', '=', 'sale')]
Only for products of type "product" (storable/consumable, not service):
[('detailed_type', 'in', ['product', 'consu'])]
Only for invoices that are paid:
[('payment_state', '=', 'paid')]
Reference the current user:
[('user_id', '=', user.id)]
Screenshots
Domain field on the report action form:
Print menu filtered for a product of type “Product”:
Print menu filtered for a product of type “Service” — unrelated reports hidden:
Compatibility
Designed and tested for Odoo 17 Community Edition. Does not modify any core views
or models beyond adding a single optional field to ir.actions.report.
Questions or issues?
Reach us at panmasiunas@gmail.com
Please log in to comment on this module