mailing_filter
A relation picker with two extra icons: save the current recipient domain as a favorite, or drop the one you loaded. On the Odoo 20 development branch the whole idea is replaced.
| Technical name | mailing_filter |
|---|---|
| Field types | many2one |
| Views | form |
| Module | mass_mailing, the Email Marketing app |
| Used in core | 1 occurrence, the favorite filter on the mailing form in mass_mailing |
| Versions | Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. It is tied to the mailing model's domain and model fields |
| Alternatives | many2one, domain, many2many_tags, field_selector |
What the favorite filter picker does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
domain_field | field | Names the char field holding the recipient domain. Read when saving a new favorite, and written when removing one so the audience is preserved.(default: mailing_domain) |
model_field | field | Names the field holding the target model. Read when saving a new favorite so the filter knows what it applies to.(default: mailing_model_id) |
no_create | boolean | Inherited from the relation picker. Core sets it, because filters are created through the save icon rather than the dropdown.(default: false) |
no_open | boolean | Inherited. Core sets it so the filter record cannot be opened from the field.(default: false) |
search_threshold | number | Inherited from the relation picker. Minimum typed characters before the search runs. |
Both options name fields the widget writes to, not just reads. Saving reads the domain field and the model field to build the new filter record; removing writes the filter's domain back into the domain field. On a model without those fields, the picker renders but neither action works.
Working examples
Why removing a favorite keeps your audience
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | Not available | Not released. The widget and the single-favorite field are removed; the mailing form moves to a many-to-many of dynamic lists. |
| Odoo 19.0 | Verified | Verified against the shipped source. |
| Odoo 18.0 | Verified | Same two options and the same save and remove behavior. |
| Odoo 17.0 | Verified | Same behavior with the older component conventions. |
| Odoo 16.0 | Verified | Same behavior with the older component conventions. |
Upgrade note. The two options and the behavior are stable from Odoo 16 through Odoo 19, so views carry over within that range. The change that needs planning is Odoo 20, where the widget and the single-favorite field both disappear. Any custom view or training material referring to a favorite filter will need rewriting.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The save icon never appears | The domain has not changed since the loaded favorite, so there is nothing new to save. Edit the recipient domain first; the icon state is recalculated after every render. |
| Saving does nothing | The name input was left empty, which is refused with a notification while the dropdown stays open. Type a name and save again. |
| Removing the favorite changed my recipients | That is the opposite of the intended behavior, which writes the filter's domain back into the mailing. Check that the domain field option names the right field; without it the write cannot happen. |
| Saving creates a filter for the wrong model | The model field option names a different field than the one the mailing uses. Set model_field to the field holding the target model. |
| Two of these on one screen misbehave | The widget finds its controls with document-wide lookups. Use only one per screen. |
| The picker is read-only | The core view makes it read-only once the mailing is sending or done. Expected. A sent mailing's audience should not change. |
Favorite filter picker vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
mailing_filter | Saving and reloading a mailing's recipient domain as a named favorite | A relation picker with inline save and remove actions that also write the mailing's own domain field |
| many2one | Selecting a saved filter without the save shortcut | No save or remove actions and no writing to the domain field |
| domain | Editing the recipient domain itself | The domain editor rather than a picker for saved ones |
| many2many_tags | Composing several saved audiences | The direction Odoo 20 takes, several filters rather than one |
| field_selector | Choosing a field inside a domain | A component of the domain editor, not an audience picker |
Frequently asked questions
What happens when I remove a favorite filter?+
Why can I not save my filter?+
Which fields does it need?+
Can I use it on another model?+
What replaces it in Odoo 20?+
Audiences you can reuse without duplicating a mailing
Segmentation, saved audiences and the data quality underneath them decide whether email marketing compounds or restarts every campaign. We set up Odoo Email Marketing and its data model on versions 16 through 19.
Book a free consultation