Skip to main content
iVentureTeam

hr_employee_chat

The speech-bubble icon beside an employee's name is hr_employee_chat: a one-icon view widget that drops you into a Discuss chat with that person, and that silently disappears when the employee has no user account.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 26, 2026Updated August 26, 20265 min read
Technical namehr_employee_chat
Viewsform (view widget, element)
Modulehr (Employees app)
Used in core2 occurrences: the hr.employee form and the hr.employee.public form
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0
No-code setupNo. It ships on employee forms; Studio has no chat button component
Alternativesmany2one_avatar_user, many2one_avatar_employee, hr_org_chart

What the employee chat widget does

HR records are about people, and the fastest thing you can do with a person is talk to them. hr_employee_chat is the widget that makes that one click: a small speech-bubble link on the employee form that opens a Discuss direct message with the employee's user.

The component is nine lines of setup around a hook. It registers as a view widget, mounts useOpenChat with the current model, and its template renders an anchor only when two conditions hold: the record has an id, so it exists in the database, and user_id is set, so there is an account to chat with. Fail either condition and the widget renders literally nothing, no disabled state, no tooltip.

What this means for your team

The widget's value is contextual reach. A manager reviewing a leave conflict, an HR officer checking a document, a colleague looking up a department, they are all already on the employee form, and the chat icon turns look up into reach out without a trip through Discuss search. On the public employee directory, where most lookups happen, the same icon works for every colleague with an account.

The silent-vanish behavior doubles as a data-quality signal. Icons missing across the directory almost always mean employees were created without linked users, which also breaks leave approvals, expense flows and appraisals. A quick filter on employees without user_id usually explains the mystery faster than any debugging.

Working examples

Adding the chat icon to a custom employee view

<field name="user_id" invisible="1"/>
<widget name="hr_employee_chat"/>

The invisible field is the part people forget; without it the icon simply never appears.

What the template checks

<a t-if="props.record.data.user_id and props.record.resId"
   t-on-click.prevent="() => openChat(props.record.resId)" .../>

Both conditions in one line: a linked user and a saved record.

One hook does the real work

The interesting part is what the widget delegates. useOpenChat(resModel) comes from Discuss's web layer and resolves the person from whatever model calls it, which is why the identical element serves hr.employee and the restricted hr.employee.public: the hook, not the widget, knows how to get from an employee id to a chat partner. Opening behavior follows Discuss conventions, a chat window docked in the corner on desktop rather than a navigation away from the form.

The click passes props.record.resId, the employee's id, not the user's. That distinction matters when patching: custom code that feeds a user_id into the hook double-resolves and opens a chat with the wrong partner or none. And since the anchor renders only on saved records, the icon appearing mid-edit after the first save is expected behavior, not a refresh bug.

Version compatibility

VersionStatusNotes
Odoo 20.0VerifiedNot released. Adds the show_label option and swaps the hook for the mail store; see below.
Odoo 19.0VerifiedVerified against the shipped source.
Odoo 18.0VerifiedSame behavior as 19. No changes needed.
Odoo 17.0VerifiedSame behavior; the open-chat hook moved to its current import path.
Odoo 16.0VerifiedSame widget with a legacy twin file; hook lived at the old mail path.

Upgrade note. View usage is identical from 16 through 19. JavaScript patches track the hook's import path, which moved from @mail/views/open_chat_hook in 16 to @mail/core/web/open_chat_hook in 17, and should expect the hook to disappear entirely in 20.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. We read the widget's file on the public development branch at the time of writing; the branch is unstable and this page will be re-verified after release.

Three changes land together. The widget gains its first option, show_label, extracted from the options dictionary, which appends a Discuss text label after the icon. The useOpenChat hook is dropped for a direct call to the mail store, store.openChat({ employeeId }). And the icon joins the FontAwesome retirement, fa-comments becoming the filled forum glyph of the new icon set. XML from 19 keeps working; patches on the hook do not.

Common problems and fixes

SymptomCause and fix
No chat icon on an employeeThe employee has no linked user account; the template renders nothing without user_id. Link a user on the HR settings tab, or accept that contractors without accounts have no chat.
Icon missing on a custom form even for employees with usersuser_id is not loaded in the view and the widget declares no field dependencies. Add user_id to the view, invisible="1" is enough.
Icon absent while creating a new employeeThe template also requires a saved record (resId). Save the record; the icon appears immediately after.
Clicking opens a chat with the wrong person after customizationA patch passed a user id into the hook, which expects the employee record's id. Pass record.resId and let the hook resolve the partner.
Icon renders but the click does nothing for some usersDiscuss could not resolve a chat partner, typically archived users or missing partner records. Check the linked user is active and has a partner; test Discuss directly with that user.

Employee chat widget vs the alternatives

WidgetBest forKey difference
hr_employee_chatOne-click Discuss chat from an employee recordRenders only when a linked user exists and the record is saved; otherwise nothing
many2one_avatar_userUser fields whose avatar popover offers chatA field widget on user relations; chat is one action on the avatar card
many2one_avatar_employeeEmployee relations shown as avatar chipsDisplays the related employee; this widget acts on the form's own record
hr_org_chartWalking the reporting line from the same formA data-fetching hierarchy view, not a single-action button

This widget is for starting a conversation from the record. If what you need is to display people, the avatar widgets carry their own chat entry points through the avatar card popovers.

Frequently asked questions

Why do some employees have the chat icon and others not?+
The icon requires a linked user account. Employees without user_id, common for workers who never log in, render no icon at all, by design and with no visual hint.
Does hr_employee_chat work on the public employee directory?+
Yes. The hook receives the record's model, so the same widget serves hr.employee.public, and core places it on that form too.
Why does the icon not show while I am creating an employee?+
The template requires record.resId, a saved record. Save once and the icon appears; there is nobody to chat about until the record exists.
Can I add a text label next to the icon?+
Not in 19; the widget has no options. The Odoo 20 development branch adds show_label, which appends a Discuss label after the icon.
What opens when I click, a window or the Discuss app?+
A Discuss chat with the employee's user, following Discuss conventions: a docked chat window on desktop, so you stay on the employee form.
Can I reuse this widget on a non-employee model?+
Not directly. The open-chat hook resolves people from employee-aware models. For other models, the user avatar widgets or a small custom widget calling the mail store are the right path.

Is your Odoo HR directory actually connected to how people talk?

Chat icons, approval routings and activity pings all hang off clean employee-user links. We audit HR data, wire Discuss into your HR workflows and build the small UX touches that make the directory the place work starts.

Make your HR setup work harder

How this page was produced

Behavior was read from employee_chat.js and its QWeb template on the Odoo 19.0 branch, compared against 16.0 through 18.0 and the development branch, and both core placements were verified in the hr view XML. Spotted an error? Tell us and we will correct the page.