Skip to main content
iVentureTeam

many2one_avatar_employee

The employee picker with a photo: many2one_avatar_employee renders an employee link as an avatar, and quietly enforces HR privacy by switching the model it reads based on the user's rights.

August 11, 2026Updated August 11, 20265 min read
Studio name(applied via the widget selector on employee fields)
Technical namemany2one_avatar_employee
Field typesmany2one (hr.employee / hr.employee.public)
Viewsform, list, kanban, activity
Also registered askanban.many2one_avatar_employee, activity.many2one_avatar_employee
Modulehr (Employees app)
Used in core59 occurrences across 14 modules, including hr, hr_holidays, hr_attendance, hr_expense, hr_timesheet, hr_skills
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupPartly: pick the widget on an employee field in Studio's Properties panel
Alternativesmany2one_avatar_user, many2many_avatar_employee, many2one_avatar, many2one

What the avatar employee field does

Anywhere an HR flow points at a person, an expense's employee, a leave request's owner, an appraisal's subject, this widget draws the photo next to the name. It composes the standard many2one with the HR avatar component, so searching, the dropdown and the record link all behave like the field users already know.

What makes it more than styling is a permission check in setup, verified in the source: the widget asks whether the current user belongs to the HR officer group, and if not, it reads from hr.employee.public, the sanitized mirror of the employee table, instead of hr.employee. Same field, same look, but a warehouse operator picking a colleague never touches records carrying salary-adjacent data.

Two hardcoded choices round it out: quick-create is off (the m2o props force canQuickCreate: false), and the link to the employee record opens only from form views unless explicitly enabled, both sensible defaults for HR data.

What this means for your team

Employee references are everywhere once HR apps are live, and two risks travel with them: private data leaking through innocent dropdowns, and junk employee records created by typo. This widget closes both by construction, which is why the honest business advice is simply: use it on every employee field, and be suspicious of views that render employees with a plain many2one.

The public-model switch also explains a support question that otherwise looks like a bug: an operations user and an HR officer can see slightly different employee lists in the same dropdown, because record rules on hr.employee.public and hr.employee differ. That is the privacy design working, and knowing it saves an escalation.

Faces also carry real workflow value in approval queues: an expense or leave list with photos is scanned by person, not read by name, and approvers triage noticeably faster.

Setting it up in Odoo Studio (no code)

Studio applies this widget in seconds.

  1. Open the view in Studio and select the employee many2one field.

  2. In Properties, open the Widget dropdown and pick the avatar employee entry.

What Studio cannot do here

The behavioral options stay in XML: forcing the model with relation, enabling the list-view link with no_open: False, or locking the dropdown down further with no_create. Each is a one-line option shown below.

Supported options in Odoo 19

Verified against many2one_avatar_employee_field.js in the Odoo 19.0 hr module. One own option plus the inherited standard many2one set (the widget builds on buildM2OFieldDescription); quick-create is removed by the component itself.

OptionTypeWhat it does
relationstringPins the model the widget reads. Unset, the source switches per user: hr.employee for HR officers, hr.employee.public for everyone else.(default: auto: hr.employee or hr.employee.public)
no_openbooleanInherited link control with the avatar-family default: unset means clickable in form views only; False forces the link on in lists.(default: unset: link in form view only)
no_createbooleanInherited: removes creation from the dropdown entirely. Quick-create is already disabled by the component; this also removes the Create-and-edit popup path.
no_create_editbooleanInherited: removes the Create and Edit popup entry.
search_thresholdnumberInherited: minimum characters before the employee search fires.
placeholder_fieldfield nameInherited: char field supplying a dynamic placeholder.

The model switch is per user, not per view. Unless relation pins it, HR users search hr.employee while everyone else searches hr.employee.public. If two users report different dropdown contents on the same screen, that is this line of the source, not a caching problem.

Working examples

Standard employee field

<field name="employee_id" widget="many2one_avatar_employee"/>

Clickable in list views

<field name="employee_id"
       widget="many2one_avatar_employee"
       options="{'no_open': False}"/>

Without the option the avatar is a plain display in lists, the same form-only default the user avatar widget has.

Pinning the model

<field name="employee_id"
       widget="many2one_avatar_employee"
       options="{'relation': 'hr.employee.public'}"/>

Forces the public model for every user, occasionally right for screens that should never show more than the directory view, whatever the viewer's rights.

The hr.employee.public switch

The one-line relation getter is the widget's whole security story, and it deserves the spotlight: this.props.relation ?? (this.isHrUser ? "hr.employee" : "hr.employee.public").

hr.employee.public is Odoo's directory-safe projection of the employee table: name, photo, job, department, contact points, and none of the private HR fields. By steering non-HR users there, the widget lets you put employee pickers on any screen, expenses, timesheets, custom models, without extending HR access rights just so a dropdown works. The check is the hr.group_hr_user group, resolved once at component start.

Two contrasts with its sibling many2one_avatar_user keep teams from mixing them up. That widget points at users (login accounts), carries Discuss presence and the Assign-to-me command; this one points at employees (HR records), has no presence dot and no command, and instead carries the privacy switch. Assignment workflows want users; HR flows want employees; a person can be both, and the two fields still should not be conflated.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. The development branch shows no behavior changes; see below.
Odoo 19.0VerifiedVerified against the shipped source and tested on a clean database.
Odoo 18.0VerifiedSame behavior. No XML changes needed.
Odoo 17.0VerifiedSame behavior. No XML changes needed.
Odoo 16.0VerifiedSame behavior. No XML changes needed.

Upgrade note. Behavior is stable across Odoo 16 to 19; views carry over. The component moved to composing the shared many2one during this range, so JavaScript patches on old internals need rework, while the registered name and options are unchanged.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The changes below are read from the public development branch and are not final until release.

Nothing changes for this widget. The development version keeps the same relation switch, the disabled quick-create, the form-only link default and both extra registrations. Internal syntax moves to the new Owl props system, affecting JavaScript patches only. We re-verify once Odoo 20 ships.

Common problems and fixes

SymptomCause and fix
Two users see different employees in the same dropdownThe per-user model switch: HR users search hr.employee, others hr.employee.public, each with its own record rules. Expected privacy behavior; pin relation explicitly if one view must behave identically for everyone.
No quick-create entry in the dropdownHardcoded off in the component; employees should be created in HR, not from a typo. By design; create employees in the Employees app.
Avatar not clickable in a listThe inherited form-only link default. Add options="{'no_open': False}".
No green presence dotPresence belongs to the user avatar widget; employees are HR records, not sessions. If presence matters, the field should target users and use many2one_avatar_user.
Archived employee shows as blank avatarThe public projection hides what record rules exclude. Restore or reassign the employee; the widget displays what the model exposes.

Avatar employee field vs the alternatives

WidgetBest forKey difference
many2one_avatar_employeeEmployee references in HR and custom flowsPrivacy switch to hr.employee.public for non-HR users; quick-create disabled
many2one_avatar_userAssignees and anything tied to a loginTargets users; adds presence and the Assign-to-me command
many2many_avatar_employeeSeveral employees on one recordMulti-value avatar pills, same employee semantics
many2one_avatarPartners or other records with a photoGeneric avatar display, no HR privacy logic
many2oneEmployee fields where a face adds nothingPlain text link, standard many2one behavior

The practical test: HR record with HR privacy, this widget. Login account for assignment and chat, the user variant. Several people on one record, the many2many avatar widgets. A partner outside the company, the generic avatar.

Frequently asked questions

How do I show an employee field with a photo in Odoo?+
Set widget="many2one_avatar_employee" on the employee many2one, or pick the avatar employee widget in Studio's Properties panel. The field should point at hr.employee (or hr.employee.public).
Why can't some users see all employees in the dropdown?+
Verified in the source: non-HR users search hr.employee.public, the sanitized directory model, while HR officers search hr.employee. Different record rules can mean slightly different lists, which is the privacy design, not a bug.
Why is there no quick-create for employees?+
The component hardcodes canQuickCreate: false. Employee records anchor contracts, leaves and payroll, so Odoo refuses to create them from a dropdown typo. Create employees in the Employees app.
What is the difference between many2one_avatar_employee and many2one_avatar_user?+
Target and extras. This widget points at employees (HR records) and carries the privacy switch; the user variant points at login accounts and adds Discuss presence plus the Assign-to-me command. Pick by what the field relates to, not by looks, which are identical.
How do I make the employee avatar clickable in list views?+
Add options="{'no_open': False}". The inherited default enables the record link only in form views, the same rule as the whole avatar family.
Does the widget work in kanban and activity views?+
Yes, through its own registrations, kanban.many2one_avatar_employee and activity.many2one_avatar_employee, which render the compact variants those views expect.

HR data on every screen, privacy intact?

Employee pickers on expenses, custom apps and portals only stay compliant when the public-model boundary is respected. We build HR flows on Odoo 16 through 19 that are convenient for users and clean for the privacy audit.

Book a free consultation

How this page was produced

The relation switch, the group check, the disabled quick-create, the form-only link default and the kanban/activity registrations were all read from the Odoo 19.0 hr module source (many2one_avatar_employee_field.js and its kanban variant file) and confirmed on a clean Odoo 19 database, where the screenshot was captured. The Odoo 20 statement comes from the same files on the public development branch, where they are unchanged. Spotted an error? Tell us and we will correct the page.