-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] ORM: do not allow invalid allowed_company_ids context key.
Since odoo@a5b6f31, the current companies of the user are saved in the context as "allowed_company_ids" context key. In case of invalid context content, the api was computing the intersection between the context content and the user company(ies) and falling back on user company_id(s) when catching an error. A sanity check was done, but no feedback was given to the user, saying that the context change was falsy. This commits changes this behavior to : * raise an AccessError when trying to access self.env.company(ies) when invalid or unauthorized companies are defined in the context. * take sudo mode into consideration, allowing inter-company impacts, even when current user doesn't have access to a given company, if the code is done in a sudoed environment. Co-Authored-By: Raphael Collet <rco@odoo.com>
- Loading branch information
Showing
2 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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