activity_model_selector
Choose a model, then choose a record: the two-step picker on the Schedule Activity wizard. Its cleverest part is protecting the summary you already typed from being wiped by the model change.
| Technical name | activity_model_selector |
|---|---|
| Field types | char |
| Views | form |
| Module | mail, the Discuss module |
| Used in core | 1 occurrence, the Schedule Activity wizard in mail |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. It depends on a server method and on companion fields of the wizard |
| Alternatives | reference, many2one, selection, list_activity |
What the activity model selector does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
res_model | companion field | Written by literal name once a record has been chosen. Never written for a model choice alone.(since Odoo 19.0) |
res_model_name | companion field | Read by literal name to seed the label shown before anything is chosen.(since Odoo 19.0) |
res_ids | companion field | Written by literal name with the chosen record. Its absence on dialog close triggers a full reset.(since Odoo 19.0) |
summary | companion field | Saved before the model change and written back afterwards, so a typed summary survives the recomputation of activity types.(since Odoo 19.0) |
note | companion field | Preserved the same way as the summary.(since Odoo 19.0) |
Four fields are read or written by literal name. The model and its label, the record ids, and the summary and notes that are preserved across the change. All of them belong to the activity wizard, which is why the widget is not portable to another model without matching those names.
Working examples
Saving your summary across a recompute
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Behavior identical on the development branch. |
| Odoo 19.0 | Verified | First version, with the reworked activity wizard. Verified against the shipped source. |
| Odoo 18.0 | Not available | Widget does not exist. |
| Odoo 17.0 | Not available | Widget does not exist. |
| Odoo 16.0 | Not available | Widget does not exist. |
Upgrade note. The widget is new in Odoo 19, with the reworked activity scheduling wizard. There is nothing to migrate from earlier versions, where linking an activity to an arbitrary record was not offered in this form.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The model list is empty | The server method returned nothing for this user, usually an access rights matter. Check which models the user may link activities to; the list is server-decided. |
| My typed summary disappeared | Something bypassed the preservation, for example a customization that changes the model directly. Change the link through the widget, which saves and restores the summary around the recompute. |
| The wizard is stuck with a model and no record | The close handler normally resets both when no record was chosen. Reopen the wizard; the model is held in local state and is not saved on its own. |
| The record label is out of date | It comes from a name lookup the widget performed when the record was chosen. Reopen the wizard to refresh it. |
| The model list does not refresh | It is memoized for the session. Reload the page after changing model access. |
| Options are ignored | The registration has no extractor. Nothing to configure here. |
Activity model selector vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
activity_model_selector | Linking an activity to a record on any model, from the scheduling wizard | A two-step picker that keeps the model in local state and preserves your summary across the change |
reference | A general model plus record picker on any model | Stores the pair in one field and needs no companion fields |
| many2one | A relation whose target model is known | One step, and enforced at the database level |
| selection | Choosing a model only | No record behind the choice |
| list_activity | Showing the next activity on a row | Displays activities rather than creating them |
Frequently asked questions
Why is it two steps?+
Why does it save my summary?+
Where does the model list come from?+
What happens if I close the record dialog without choosing?+
Can I use it elsewhere?+
Follow-ups that actually get followed up
Activities, their types and the automation that creates them are the difference between a CRM people work from and one they update afterwards. We configure Odoo activities and automation on versions 16 through 19.
Book a free consultation