many2one_avatar_leader_user
A user picker that knows who runs the team: many2one_avatar_leader_user renders the standard avatar dropdown and marks the selected sales team's leader with a (Team Leader) tag.
| Technical name | many2one_avatar_leader_user |
|---|---|
| Field types | many2one (res.users) |
| Views | form, list |
| Module | crm (CRM app) |
| Used in core | 3 occurrences across crm and event_crm |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. XML only; Studio does not expose it |
| Alternatives | many2one_avatar_user, many2one_avatar_employee, many2one |
What the leader picker widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
teamField | attribute (camelCase) | Required. Names the many2one field on the same record holding the crm.team whose leader should be tagged in the dropdown. Written as an XML attribute, not an option.(since Odoo 19.0) |
no_open | boolean | Inherited from the many2one family. Disables navigating to the user record from the chip. |
no_create | boolean | Inherited from the many2one family. Removes user creation from the dropdown, usually desirable for user fields. |
teamField is an attribute and it is mandatory. It is declared as a required prop, so the widget without the attribute does not degrade to a plain avatar picker, it fails OWL props validation. It is also camelCase XML, written directly on the field element, not inside options="{}". The getter reads the team id off the record without an empty-value guard, so keep the widget next to a team field that is required or defaulted.
Working examples
How the Team Leader tag is decided
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Props migration only on the development branch; behavior identical. See below. |
| Odoo 19.0 | Verified | Introduced in 19.0; verified against the shipped source and the res.users override. |
| Odoo 18.0 | Not available | Does not exist; use many2one_avatar_user. |
| Odoo 17.0 | Not available | Does not exist. |
| Odoo 16.0 | Not available | Does not exist. |
Upgrade note. New in Odoo 19; earlier versions have no equivalent and the plain many2one_avatar_user is the fallback when backporting views.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| View crashes with a props validation error | The teamField attribute is missing; it is a required prop. Add teamField="your_team_field" to the field element. |
| No Team Leader tag on anyone in the dropdown | The selected team has no user_id set as leader, or the team field is pointing at a different record than expected. Set the leader on the crm.team record and check the teamField name. |
| Widget errors when the team field is empty | The component reads the team id without an empty guard. Make the team field required or defaulted wherever this widget is used. |
| Tag shows in the dropdown but not on the selected value | The marker is appended only under the dropdown's formatted-name context. Expected behavior; the stored name stays clean by design. |
| Tag does not update after changing the team | It does, but only on the next dropdown search, which re-reads the team id. Reopen the dropdown after switching teams. |
Leader picker widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
many2one_avatar_leader_user | User pickers on records that carry a sales team | Tags the team's leader inside the dropdown via a context handshake |
| many2one_avatar_user | General user assignment fields | Same avatar chip without the leader logic or the team dependency |
| many2one_avatar_employee | Employee rather than user references | Targets hr.employee and switches relation by HR access |
| many2one | Plain relational fields | No avatar, no extra behavior, lightest option |
Frequently asked questions
What does many2one_avatar_leader_user add over many2one_avatar_user?+
How does Odoo know who the team leader is?+
Why is teamField an attribute instead of an option?+
Is the Team Leader text stored anywhere?+
Can I use the widget outside CRM?+
Does it change in Odoo 20?+
Lead routing that lands on the right desk
We design CRM assignment flows where teams, leaders and round-robin rules are visible at the moment of configuration, not discovered after a quarter of misrouted leads. Custom pickers like this one are small builds with outsized effect on pipeline hygiene.
Review my lead assignment setup