This module allows setting an application domain on mail templates.
When a domain is configured on a template, that template will only appear in the email composer when the active record matches the domain. Templates without a domain continue to appear for all records of the applicable model.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Lets you restrict a mail template so it only appears in the email composer when the record you are emailing matches a condition you define. Templates without a restriction keep showing for all records.
This module adds an optional restriction to email templates. On the template form, after the model field, you get a "Restrict to" checkbox and, when ticked, a domain builder where you define the condition a record must meet for the template to be offered.
When someone opens the email composer (for example from a quotation, invoice or any record), Odoo checks each template of that model. Templates with no restriction, or with an empty condition, are always offered. Templates with a condition are offered only if every record being emailed matches it. The template list in the composer is filtered accordingly, and the search limit is raised so all matching templates remain reachable.
Business rules and automatic behaviour: - Unticking "Restrict to" automatically resets the condition to empty. - Changing the template's model also resets the condition to empty. - The condition is stored on the template and evaluated live against the selected records.
It touches the email template model mail.template and the email composer mail.compose.message, and adds fields to the template form view.
Depends on
Models and fields (2)
- mail.template · extends an existing modelfilter_model (Restrict?), filter_domain (Restrict domain)
- mail.compose.message · extends an existing modeltemplate_id, domain_template_id
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 2 confirmed, 7 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/mail.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0To use this module:
- Go to Settings > Technical > Email > Templates.
- Open or create a mail template.
- Select an option under Applies to (such as Contact).
- Check the Restrict to checkbox, set the domain that records must match for this template to appear in the composer (e.g.
[('is_company', '=', True)]to show the template only on contacts where Is a Company is set). - Leave Apply on empty to keep the template available for all records of the model (default behaviour).
When a user opens the email composer from a record, only templates whose Apply on domain matches that record will be listed in the Load template dropdown.
No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.