| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1210 |
| Technical Name |
odoo_shell_terminal |
| License | OPL-1 |
| Website | https://github.com/MihranThalhath |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1210 |
| Technical Name |
odoo_shell_terminal |
| License | OPL-1 |
| Website | https://github.com/MihranThalhath |
Odoo Shell Terminal
A browser-based Python shell and live log viewer — accessible from the systray as a floating panel. No SSH. No server access. Just open and run.
✦ Developed with the help of AI
See It In Action
Shell tab and live log viewer running in the browser
Shell Tab — Interactive Python REPL
Logs Tab — Live Server Log Stream
What's Included
Everything you need to interact with your live Odoo instance from the browser
Interactive Shell
Full Python REPL against the live Odoo environment. env, uid, and user are pre-bound. Single expressions auto-print their value.
Persistent Sessions
Namespace survives across executions. Define a variable, use it in the next command. Sessions idle out after 10 minutes and can be reset manually.
Live Log Viewer
Real-time server logs via SSE. Backlog of 2,000 lines on connect. Color-coded by level: DEBUG, INFO, WARNING, ERROR, CRITICAL.
Access Control
Gated behind the Odoo Shell User group. A server-side constraint enforces that only Technical Administrators can be assigned — raises a ValidationError otherwise.
Rate Limiting & Audit Log
Max 30 executions per user per minute. Every execution is audit-logged with uid, database, SHA-256 hash, and full code body.
Debug Mode Only
The systray icon only appears when Odoo is running in debug mode (?debug=1) — invisible in normal mode as an extra safety layer.
⚠️ With great power comes great responsibility
The shell gives you direct, unrestricted access to the Odoo ORM and the underlying PostgreSQL database. Treat it with the same care as direct database access.
Database changes require an explicit commit
The shell session runs on its own cursor that is not auto-committed. Writes will not be persisted until you call:
env.cr.commit()
If you close or reset the session without committing, all changes are rolled back automatically.
env['res.partner'].search([]).unlink()+env.cr.commit()= all partners deleted, no undo- Forgetting to commit = writes silently disappear
- Committing mid-script = database left in a partially updated state
Grant this group only to trusted Technical Administrators. Do not enable on production systems unless you fully understand the consequences.
Getting Started
Up and running in five steps
Install
Find Odoo Shell Terminal in Apps and install
Technical Admin
User must already be a Technical Administrator
Grant Access
Assign Odoo Shell User group in Settings > Users
Debug Mode
Add ?debug=1 to URL to reveal the systray icon
Run Code
Type Python, press Enter. Call env.cr.commit() to save
Configuration
No config file needed — tune constants in controllers/shell.py
| Constant | Default | Description |
|---|---|---|
SESSION_IDLE_TIMEOUT | 600 s | Idle time before session eviction |
MAX_SESSIONS | 3 | Max concurrent sessions (LRU eviction) |
MAX_CODE_LEN | 10 000 chars | Max code length per execution |
RATE_WINDOW_SECS | 60 s | Rate-limit sliding window |
RATE_MAX_REQUESTS | 30 | Max executions per user per window |
Security Group
| Group | Prerequisite | Access |
|---|---|---|
| Odoo Shell User | base.group_system (Technical Administrator) |
Shell terminal + live log viewer |
A @api.constrains on both res.groups and res.users raises a ValidationError if a non-admin user is assigned. The systray icon is additionally hidden outside of debug mode.
Known Limitations
- Multi-worker: Sessions are worker-bound — use
--workers=1orgeventduring development. - Log viewer: Only captures logs from the worker handling the SSE connection. Configure a shared
--logfileto see all workers. - No autocomplete: Syntax highlighting and autocomplete are not yet supported.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module