odoo/odoo#163305

Created by Bugfix, Altaf Shaik (alsh)
Merged at c6d37ba9a9da24a63a0cdb5159e59a5d2d9f343a

Statuses:

Linked pull requests
label
odoo-dev:saas-17.1-sentry-3954475523-valueerror-hr-alsh
head
069492d8eb0a2069283804f908813a03d8612844
merged
1 year ago by Fun HR, Bertrand Dossogne (bedo)
odoo/odoo odoo/enterprise
saas-17.1 #163305 #61444
saas-17.2 #163585 #61578
18.0
saas-18.1
saas-18.2
saas-18.3
saas-18.4
master #163610 #61592

[FIX] hr: fix traceback when click on employee avatar

This traceback occurs when the user clicks on the employee avatar in the employee form view.

<h4>To reproduce this issue:-</h4>

1) Install Employees
2) open any employee record
3) click on the avatar of manager or coach
4) A traceback occurs

Error:-

ValueError: Invalid field &#39;employee_ids&#39; on model &#39;hr.employee

When the user clicks on the employee avatar in the Employee module a traceback occurs after [1].
Because the employee_ids field is not present in hr.employee.

which leads to the above traceback when the read method [2] triggers
with the model as hr.employee and fields including employee_ids

[1]
#157907/commits/fdc0693968b5e50b625406a38e26817d6d9d63ea
[2]
https://github.com/odoo/odoo/blob/503e9cbf16762cfd753c4427e13228c135db21d5/addons/resource_mail/static/src/components/avatar_card_resource/avatar_card_resource_popover.js#L32-L33

This commit will resolve this issue based on the model in props
to concat employee_id or employee_ids in the fields.

Related Enterprise PR:- odoo/enterprise#61444

sentry-3954475523