odoo/odoo#163305

Created by Altaf Shaik (alsh)
label
odoo-dev:saas-17.1-sentry-3954475523-valueerror-hr-alsh
head
069492d8eb0a2069283804f908813a03d8612844
target
saas-17.1
merged
3 weeks ago by Fun HR, Bertrand Dossogne (bedo)
forward-ports

[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 'employee_ids' on model '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]
https://github.com/odoo/odoo/pull/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:- https://github.com/odoo/enterprise/pull/61444

sentry-3954475523