Skip to main content
OdooLS implements the full suite of LSP navigation features so you can move through a large Odoo codebase the same way you would any other language: jump to definitions, find all usages, and search across the whole project by name.

Go-to-definition

Press F12 (or your IDE’s equivalent) to jump from a symbol to where it is declared. OdooLS resolves definitions for:
  • Python symbols — classes, functions, variables, and parameters
  • Models — a string like "res.partner" in self.env["res.partner"] jumps to the class that declares _name = "res.partner"
  • Fieldsself.partner_id jumps to the partner_id = fields.Many2one(...) declaration on the model
  • XML IDs — a ref attribute in XML or a env.ref("module.xml_id") call jumps to the <record id="xml_id" ...> definition
  • Module names in __manifest__.py — a string in the depends list jumps to that module’s __manifest__.py (added in 1.2.0)
  • Import statementsfrom odoo.addons.sale.models.sale_order import SaleOrder jumps to the imported file or symbol (added in 1.2.0)

Special cases

Going to definition on a display_name attribute does not land on the generic display_name field declaration. Instead, OdooLS redirects you to the _compute_display_name method (or equivalent) on the model that defines the display logic.
Activating go-to-definition on a plain string literal (e.g., a comment value or an arbitrary string) does nothing — it will not redirect to the built-in str class definition. Only strings that OdooLS can semantically resolve (model names, XML IDs, field names) produce a navigation result.
String field names inside a search domain tuple — e.g., [("partner_id.name", "ilike", "Acme")] — support go-to-definition and will navigate to the field declaration on the relevant model.

Find references

Use Find All References (Shift+F12 in VS Code) to locate every place a symbol is used. OdooLS tracks usages across Python files and XML data files, so you can see both Python code that references a record and XML files that use its ID.

Document symbols

The Outline panel in your IDE (populated via the LSP textDocument/documentSymbols request) shows a structured view of the current file. OdooLS includes:
  • Classes — including Odoo models with their _name
  • Functions and methods
  • Assignments — module-level variables and field declarations
  • XML records<record> elements are listed by their id attribute when viewing XML files
This lets you quickly navigate to any class or function in a long file without scrolling.

Workspace symbols

Workspace symbol search (Ctrl+T in VS Code, or your IDE’s equivalent) lets you search for any named symbol across the entire project — not just the open file. (Added in 1.2.0) OdooLS indexes the following symbol types for workspace search:
Symbol typeSearch formatExample
Python class / functionPlain nameSaleOrder
Odoo model nameQuoted string"sale.order"
XML IDxmlid. prefixxmlid.sale.action_quotations

Search examples

SaleOrder               → finds the Python class
"sale.order"            → finds the model declaration
xmlid.sale.action       → finds XML IDs starting with sale.action
Workspace symbol search scans all indexed entry points except built-in and public stubs, keeping results focused on your actual project code and addon paths.

Module hover and navigation in manifests

In __manifest__.py files, each string in the depends list is a navigable symbol. (Added in 1.2.0)
  • Go-to-definition jumps to the dependency module’s __manifest__.py.
  • Hover shows the module’s full dependency tree (see Hover Information).

Build docs developers (and LLMs) love