- Notifications
You must be signed in to change notification settings - Fork28.6k
[FW][FIX] hr_expense: prevent access error when checking vendor bill warning#202987
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Closed
fw-bot wants to merge1 commit intoodoo:saas-17.4fromodoo-dev:saas-17.4-17.0-opw-4539017-commercial_partner_id-access-rights-azey-423390-fw
Closed
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
When a user tries to access a vendor bill where the vendor is their own company,Odoo displays a warning indicating that the user is trying to invoice themselves.To determine whether to show this warning, we check if the partner has anyrelated `employee_ids`.However, if the user does not have the `"Employees / Officer: Manage all employees"`access rights, they cannot check the `employee_ids`, leading to an access errorwhen opening the vendor bill.Steps to Reproduce:1. Create a vendor bill where the vendor is set to your own company.2. Try to access the vendor bill with a user who does not have`"Employees / Officer: Manage all employees" access rights.Issue: An error occurs because the user lacks permission to checkthe related `employee_ids` for the vendor.opw-4539017X-original-commit:0008db8
This PR targets saas-17.4 and is part of the forward-port chain. Further PRs will be created up to master. More info athttps://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@robodoo r+ |
robodoo pushed a commit that referenced this pull requestMar 24, 2025
When a user tries to access a vendor bill where the vendor is their own company,Odoo displays a warning indicating that the user is trying to invoice themselves.To determine whether to show this warning, we check if the partner has anyrelated `employee_ids`.However, if the user does not have the `"Employees / Officer: Manage all employees"`access rights, they cannot check the `employee_ids`, leading to an access errorwhen opening the vendor bill.Steps to Reproduce:1. Create a vendor bill where the vendor is set to your own company.2. Try to access the vendor bill with a user who does not have`"Employees / Officer: Manage all employees" access rights.Issue: An error occurs because the user lacks permission to checkthe related `employee_ids` for the vendor.opw-4539017closes#202987X-original-commit:0008db8Signed-off-by: Olivier Colson (oco) <oco@odoo.com>Signed-off-by: Abdelaziz EL HAYYANY (azey) <azey@odoo.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a user tries to access a vendor bill where the vendor is their own company, Odoo displays a warning indicating that the user is trying to invoice themselves. To determine whether to show this warning, we check if the partner has any related
employee_ids
.However, if the user does not have the
"Employees / Officer: Manage all employees"
access rights, they cannot check theemployee_ids
, leading to an access error when opening the vendor bill.Steps to Reproduce:
"Employees / Officer: Manage all employees"
access rights. Issue: An error occurs because the user lacks permission to check the relatedemployee_ids
for the vendor.Refer to thisvideo for clearer steps.
opw-4539017
I confirm I have signed the CLA and read the PR guidelines atwww.odoo.com/submit-pr
Forward-Port-Of:#202033