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

[15.0][FIX] hr_employee_birth_name: Fixed bug when accessing hr.employee #1160

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

vincent-hatakeyama
Copy link
Contributor

No description provided.

@nimarosa
Copy link
Contributor

@vincent-hatakeyama can you explain what bug is fixed?

@moctarjallo
Copy link

@nimarosa we are getting the following error using the module:

ValueError: Invalid field 'birth_name' on model 'hr.employee.public'

This is because Odoo has already prevented this situation here from line 21 to 27.

Basically you need to add access rights to the field like this groups="hr.group_hr_user"

@etobella
Copy link
Member

Wouldn't be better to add the data on the res.users profile in order to make it visible to the user:

https://github.com/odoo/odoo/blob/15.0/addons/hr/models/res_users.py#L157-L163

@vincent-hatakeyama
Copy link
Contributor Author

Wouldn't be better to add the data on the res.users profile in order to make it visible to the user:

https://github.com/odoo/odoo/blob/15.0/addons/hr/models/res_users.py#L157-L163

I agree but I think this would be an improvement to add to a new issue/pr.

@vincent-hatakeyama vincent-hatakeyama changed the title Fixed bug by adding hr.group_hr_user group to field birth_name of hr.employee [15.0][FIX] hr_employee_birth_name: Fixed bug when accessing hr.employee Nov 22, 2022
@vincent-hatakeyama vincent-hatakeyama force-pushed the topic/15.0/fix-hr_employee_birth_name branch from 6135bb1 to a24ab80 Compare December 6, 2022 14:37
Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

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

Add it following my comment please

@pedrobaeza pedrobaeza added this to the 15.0 milestone Feb 20, 2023
@pedrobaeza
Copy link
Member

Actually, this is the official way to fix this kind of problem: https://github.com/odoo/odoo/blob/c55badb8d70bdccfeb82bffb330d3f0b1b162ed1/addons/hr/models/hr_employee.py#L23, so I see it correct.

@nimarosa
Copy link
Contributor

For me this fix it's okay. I think we should merge since it's important to fix al permissions errors.

Is this also affecting 14.0 branch? Or only 15.0?

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 15.0-ocabot-merge-pr-1160-by-nimarosa-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit de276d9 into OCA:15.0 Feb 20, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 41ee265. Thanks a lot for contributing to OCA. ❤️

@vincent-hatakeyama
Copy link
Contributor Author

Is this also affecting 14.0 branch? Or only 15.0?

Looking at the code in 14.0, it seems affected too.

@nimarosa
Copy link
Contributor

Is this also affecting 14.0 branch? Or only 15.0?

Looking at the code in 14.0, it seems affected too.

@vincent-hatakeyama It would be good if you can port it to 14.0 and I think 16.0 will have the same problem. That way we maintain the same code in all versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants