execute_odoo_code
Run Python code in an Odoo shell environment to access and manipulate Odoo models and database. Maintains state between executions for persistent variable access.
Instructions
Execute Python code in an Odoo shell environment with full access to Odoo models and environment.
This tool provides direct access to the Odoo ORM and all loaded modules through
the shell environment. The ``env`` variable is available for accessing models,
and all standard Odoo shell features are accessible.
:param code: Python code to execute in the Odoo context
:type code: str
:return: The output from executing the code
:rtype: str
.. note::
The shell maintains persistent state between calls, so variables
defined in one execution will be available in subsequent calls.
.. warning::
Code executed through this tool has full access to the Odoo database
and can modify data. Use with appropriate caution.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
code | Yes |
Input Schema (JSON Schema)
{
"properties": {
"code": {
"title": "Code",
"type": "string"
}
},
"required": [
"code"
],
"title": "execute_odoo_codeArguments",
"type": "object"
}