Repository navigation
Conversation
Since Odoo 19.0, ir.model is no longer readable by internal users (base.group_user gets perm_read=0). _get_tool_definition and _execute_tool read model_id.model to dispatch the tool, so a call made under a non-admin environment raised an AccessError. Read the related model through sudo() only for the ir.model lookup; the returned env stays bound to the calling user, so tool methods still run with the caller's permissions. Assisted-by: Devin:SWE-2 High
Member
Author
|
Closing in favor of #119, which carries the same ir.model sudo fix plus the _ai_get_date output-schema correction. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since Odoo 19.0,
ir.modelis no longer readable by internal users (base.group_usergetsperm_read=0)._get_tool_definitionand_execute_toolreadmodel_id.modelto dispatch the tool, so a call made under a non-admin environment — e.g. the MCP endpoint inai_oca_mcp, which switches to the key owner's user viawith_user— raised an AccessError and returned HTTP 403.The fix reads the related model through
sudo()only for their.modelname lookup; the returnedenvstays bound to the calling user, so tool methods still run with the caller's permissions.This unblocks the
ai_oca_mcp19.0 migration (non-admin key tests).