Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

alsh-odoo
Copy link
Contributor

@alsh-odoo alsh-odoo commented Apr 25, 2024

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

To reproduce this issue:-

  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]
fdc0693
[2]

async onWillStart() {
[this.record] = await this.orm.read(this.props.recordModel, [this.props.id], this.fieldNames);

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

@robodoo
Copy link
Contributor

robodoo commented Apr 25, 2024

@C3POdoo C3POdoo added the RD research & development, internal work label Apr 25, 2024
@adwid adwid requested a review from abla001 April 25, 2024 09:38
@alsh-odoo alsh-odoo force-pushed the saas-17.1-sentry-3954475523-valueerror-hr-alsh branch 3 times, most recently from 0ca4ddf to d43a9a9 Compare April 25, 2024 10:13
Copy link
Contributor

@abla001 abla001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@alsh-odoo alsh-odoo marked this pull request as ready for review April 25, 2024 13:12
@C3POdoo C3POdoo requested a review from a team April 25, 2024 13:14
Copy link
Contributor

@Bertrand2 Bertrand2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your fix! :)

LGTM aside from the comment.

This traceback is occurring when the user tries to click on
employee avatar in the employee form view.

To reproduce this issue:-

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 is occurring 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]
odoo@fdc0693
[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.

sentry-3954475523
@alsh-odoo alsh-odoo force-pushed the saas-17.1-sentry-3954475523-valueerror-hr-alsh branch from d43a9a9 to 069492d Compare April 26, 2024 09:02
@alsh-odoo
Copy link
Contributor Author

Hello @Bertrand2

Thanks for reviewing the PR!

The requested changes are Done. Please check

Thank You 🙂

@Bertrand2
Copy link
Contributor

robodoo r+

robodoo pushed a commit that referenced this pull request Apr 26, 2024
This traceback is occurring when the user tries to click on
employee avatar in the employee form view.

To reproduce this issue:-

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 is occurring 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]
fdc0693
[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.

sentry-3954475523

closes #163305

Related: odoo/enterprise#61444
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
@robodoo robodoo closed this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants