Your complete Odoo development environment inside VS Code. Run and debug the server, navigate code with full Odoo awareness, explore models, hover for instant context, browse database records, watch live logs — all without leaving your editor.
Setup
1 — Install the extension
Install from the VS Code marketplace. ms-python.debugpy is automatically installed as a dependency.
2 — Select Python interpreter
Ctrl+Shift+P → Python: Select Interpreter → pick your Odoo virtualenv.
3 — Point to your Odoo conf file (recommended)
"odooDebugger.configFile": "/path/to/.odoorc"
The extension reads db_name, db_host, db_port, db_user, db_password, addons_path, and http_port directly from the conf file.
4 — Configure addons paths
Click the folder icon in the panel title bar → Manage Addons Paths, or set directly:
"odooDebugger.addonsPaths": [
"/path/to/odoo/community/addons",
"/path/to/custom-addons"
]
5 — Run Odoo
Press Ctrl+Shift+R or click Run in the panel.
Panel Layout
| Section | Purpose |
|---|---|
| Odoo Debugger | Server controls, module actions, tools |
| Model Explorer | Browse all models, fields, functions, views |
| SQL Tools | Browse tables, run queries |
| Tools | JS debug, utilities, scaffold |
| Breakpoints | Manage all breakpoints |
| Odoo Logs | Live log panel at the bottom |
Features
Server Management
- Run (
Ctrl+Shift+R) — starts Odoo via debugpy in no-debug mode - Debug (
Ctrl+Shift+D) — full debugpy session with breakpoints active - Stop (
Ctrl+Shift+S) — stops the running server - Restart — stops and re-launches in the same mode
- Status bar — shows server state, DB name, and live index count
- Click the status bar item to see index stats: model count, field count, function count, view count, module count
- Shows a spinner while indexing
Module Management
- Update (
Ctrl+Shift+U) — QuickPick with git-changed modules shown first - Install (
Ctrl+Shift+I) — same picker, runs--init - Update Changed (
Ctrl+Shift+G) — auto-detects modules with uncommitted git changes - Uninstall — opens Odoo shell with uninstall command ready
- Scaffold — generates a full module: manifest, model, views, security CSV, menu, action
Right-click any .py or .xml file in the editor or explorer:
- Update This Module — auto-detects module from file path, runs immediately
- Install This Module — same, runs
--init
Build output appears in the Odoo Logs panel automatically.
Background Indexing
On startup, background workers index your addons. The index powers all code intelligence features.
| Slice | Content |
|---|---|
models |
Model names, types, inheritance chains |
fields |
Field definitions with comodel, related, compute, selection |
functions |
Method signatures, decorators, @api.depends fields |
views |
XML view inheritance tree |
fieldXml |
Field usages in XML views |
Saving a .py or .xml file re-parses only that file and merges into the index instantly. No full restart.
Code Intelligence — Completions
Completions are context-aware and Odoo-specific:
self.env['— suggests model names filtered to your module's dependency treeself.env[— triggers immediately after[, no quote neededself.field_name.— follows Many2one chains and suggests fields on the target model@api.depends(',@api.onchange(',@api.constrains('— suggests field names from the current modelfields.Many2one('— suggests model names from your dep treefields.One2many('model', '— second argument suggests only Many2one fields from the comodel (validinverse_namevalues)_inherit = ',_name = '— model name completions- XML
<field name="— suggests field names from the view's model - XML
<record model="— model names - XML
ref="— XML IDs from your index
Code Intelligence — Navigation
Go to Definition (F12)
Jumps to the definition of the symbol at the cursor:
- Model name string — goes to the class where
_nameis declared - Field name — goes to the field declaration
- Method name — goes to the method
- XML
ref="module.id"— goes to the XML record compute=,inverse=,search=string values — goes to the method
Go to Declaration (Ctrl+F12)
Goes to the original declaration — the source file where the model or field was first created, not an _inherit override. Useful when a field is extended in multiple modules.
Find All References (Shift+F12)
Shows every usage of the symbol across the codebase:
- Field — Python declarations, XML
<field name="...">usages, method bodies accessingself.field - Model — class declarations, XML views, relational fields pointing to it
- Method — incoming calls, XML
<button name="...">usages - XML id — all
ref="..."usages
Go to Model from selection (Ctrl+Shift+M)
Puts the word under cursor in the model picker and jumps directly.
Go to XML ID (Ctrl+Shift+X)
Finds any id="..." record in XML.
Toggle Python / XML (Ctrl+Shift+T)
Jumps between the model .py file and its _views.xml counterpart.
Workspace Symbols (Ctrl+T)
Search all indexed Odoo symbols globally:
| Search | Result |
|---|---|
SaleOrder |
Class / model by Python name |
action_confirm |
Method across all models |
partner_id |
Field across all models |
"sale.order" |
Model by dotted name |
xmlid.sale.action_quotations |
XML ID |
Code Intelligence — Hover
Python file hover
Hover any Odoo symbol for instant context:
- Model class /
_name/_inherit— shows inherited modules, field count, method count, full inheritance chain - Field definition — shows type, comodel, compute method, related chain, flags (required/readonly/store), XML views using this field
- Method definition — shows decorators,
@api.dependsfields, override chain, callers - Model string
'res.partner'— shows model summary __manifest__.pydepends list — hover any dependency name to see that module's direct and transitive deps, version, and description
XML file hover
model="res.partner"— shows model summary<field name="partner_id">— shows field type and Python declarationref="module.view_id"— shows view name, model, inheritance tree
Code Intelligence — Diagnostics
The extension highlights code issues as you type or save:
- Domain field validation — warns when a domain references a field that does not exist on the model. Handles prefix-operator domains (
['|', ('f1', op, v1), ('f2', op, v2)]) and multi-line domains correctly. - Missing super() in ORM overrides — warns when
create(),write(),unlink(),copy()or other ORM methods are overridden without callingsuper(). - Unused @api.depends field — warns when a field listed in
@api.depends('field1', 'field2')is never accessed asself.field1in the method body. - Deprecated
attrs=in XML — highlightsattrs={"invisible": [...]}in XML with a quickfix to auto-convert to Odoo 17/18 inline syntax (invisible="state != 'draft'").
Code Intelligence — Quickfixes
- attrs= to inline — click the lightbulb on any
attrs=line to convert a single line or the entire file to Odoo 18 inline attribute syntax. Handles|,&,!operators in domains. - @api.depends suggestion — inside any
_compute_method, a quickfix suggests fields to add to@api.dependsbased onself.fieldaccesses in the method body.
Code Intelligence — Outline
The Outline panel (and breadcrumbs) show a clean Odoo-aware symbol tree for Python, XML, and JavaScript files:
Python files:
- Model with
_namelabel (e.g.res.partner [+]) - Fields grouped under the model
- Methods with full signatures:
action_confirm(self),_compute_total(self, vals) - Decorators shown as icons
- Nested defs shown as children
XML files:
- Views labeled by tag and purpose:
<form> sale.order,<rule> Allow All - Records:
<cron> Clean Old Sessions - Menus, actions, security rules with meaningful labels
JavaScript files:
- OWL components with
setup(), lifecycle, event handlers - Patches:
patch(ClassName, {...}) - Registry entries:
registry.category('...').add(...) - Arrow functions, static properties, imports
Model Explorer
Tree view of all models with full deep inheritance:
- Fields — type description, comodel link, compute method, flags
- Functions — full signature
(params) -> returnType, decorators - Views — full inheritance tree per model
- Auto-reveal — cursor movement auto-highlights the matching model/field/method in the tree
Right-click model — Go to XML View, Open in Odoo Browser, Browse Records, Copy Model Name
Right-click field — Find in XML Views, Browse Field Values
Right-click method — Find Method Usages
Quick Find
Ctrl+Alt+N — live search with compound syntax:
| Input | Result |
|---|---|
res.partner |
models matching name |
@name |
models with field starting with name |
#action |
functions starting with action |
:sale |
models from module sale |
res.partner@name |
fields in res.partner only |
res.partner#action |
functions in res.partner only |
Log Panel
Live log panel at the bottom:
- Filter buttons — ALL / CRITICAL / ERROR / WARNING / INFO / DEBUG with counts
- Search — live search with highlight
- Err navigation — jump to previous/next error
- Traceback grouping — collapsed by default, click to expand
- File links —
File "path.py", line 42are clickable, jump directly to that line - Dense mode — toggle to show only time + level + message for a more compact view
- Font size — A- / A+ buttons scale the entire panel; size is saved across restarts
- Path reduction — long file paths shown as
.../module/file.py, full path on hover - Editor tab — open the log in a standalone editor tab that can be dragged to any window or monitor
Data Browser
Interactive table in an editor tab:
- Browse model records or field values from DB
- Sortable columns,
%term%search, custom SQL bar - Open in Odoo form view, copy cell value on double-click
SQL Tools
- Tables — all public tables, filterable. Browse, show columns, copy SELECT
- History — last 20 queries, click to re-run
- Run SQL (
Ctrl+Shift+Q) — result in data browser
JS Debugging
- Launch Chrome Debug — opens Chrome with remote debugging port +
?debug=assets - Attach JS Debugger — attaches VS Code to Chrome with auto-generated
pathMappingfrom your addons paths
Database Tools
- Switch Database — lists all PostgreSQL DBs
- Copy Database —
createdb -T source newname - Drop Database — with confirmation
- Clear Asset Bundles — deletes
/web/assets/*attachments (force-regenerate JS/CSS bundles)
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+Shift+R |
Run Odoo |
Ctrl+Shift+D |
Debug Odoo |
Ctrl+Shift+S |
Stop Odoo |
Ctrl+Shift+U |
Update Module |
Ctrl+Shift+I |
Install Module |
Ctrl+Shift+G |
Update Changed Modules |
Ctrl+Shift+B |
Open Odoo in Browser |
Ctrl+Shift+O |
Open Odoo Shell |
Ctrl+Shift+Q |
Run SQL |
Ctrl+Shift+M |
Go to Model |
Ctrl+Shift+X |
Go to XML ID |
Ctrl+Shift+T |
Toggle Py / XML |
Ctrl+Shift+. |
Go to Function Definition |
Ctrl+Alt+N |
Quick Find |
Ctrl+Alt+E |
Focus Panel |
F12 |
Go to Definition |
Ctrl+F12 |
Go to Original Declaration |
Shift+F12 |
Find All References |
Ctrl+T |
Workspace Symbol Search |
Settings Reference
| Setting | Default | Description |
|---|---|---|
odooDebugger.configFile |
.odoorc |
Odoo conf file path |
odooDebugger.database |
`` | DB name (auto-read from conf) |
odooDebugger.addonsPaths |
[] |
Addons directories |
odooDebugger.odooBinPath |
`` | Path to odoo-bin (auto-detected) |
odooDebugger.venvPath |
`` | Python interpreter (auto-detected) |
odooDebugger.port |
8069 |
Odoo HTTP port |
odooDebugger.extraArgs |
[] |
Extra odoo-bin args |
odooDebugger.debugOptions |
{justMyCode:false} |
debugpy launch options |
odooDebugger.dbHost |
`` | PostgreSQL host |
odooDebugger.dbPort |
`` | PostgreSQL port |
odooDebugger.dbUser |
`` | PostgreSQL user |
odooDebugger.dbPassword |
`` | PostgreSQL password |
odooDebugger.logPanel.enabled |
true |
Enable log panel |
odooDebugger.logPanel.logFile |
/tmp/odoo-vscode.log |
Log file path |
odooDebugger.logPanel.autoEditorTab |
false |
Always open log in editor tab |
odooDebugger.captureStdout |
false |
Show print() output in log panel as [PRINT] entries |
odooDebugger.outline.labelMode |
short |
short or full outline labels |
odooDebugger.notifications |
all |
Toast notifications: all, errors-only, silent, auto-dismiss |
odooDebugger.modelExplorer.sources |
[] |
Addons dirs to scan (empty = use addonsPaths) |
odooDebugger.modelExplorer.groupByModule |
true |
Group by module |
odooDebugger.modelExplorer.sortOrder |
alpha |
alpha or recent |
odooDebugger.modelExplorer.typeFilter |
model |
Default type filter on startup |
odooDebugger.modelExplorer.showViews |
true |
Show Views folder |
odooDebugger.modelExplorer.autoReveal |
true |
Auto-reveal on cursor move |
odooDebugger.upgradeScript |
`` | Custom upgrade script |
odooDebugger.chromePath |
`` | Chrome binary path |
odooDebugger.chromeDebugPort |
9222 |
Chrome debug port |
Requirements
- VS Code
1.85.0or later ms-python.debugpyextension (auto-installed)- Python with Odoo dependencies installed
- PostgreSQL with
psqlon PATH - Odoo source with
odoo-bin
License
MIT © Mohit Ghodasara