Skip to content

Python Intelligence

rafageist edited this page Dec 5, 2026 · 2 revisions

Python Intelligence

Through basedpyright, the language server, with the Odoo source you configured in Options > Python and Odoo (see Getting Started). It starts with the first Python file and stops with Turbodoo.

  • Completion opens as you type (Ctrl+Space, Ctrl+N or Edit > Complete asks), with the documentation of the selected name beside the list; a call's signature shows over the line. Typing fast does not pile requests up: the one the next key replaces is cancelled in the server. When you ask and the server does not answer in time (its first answers on a large Odoo tree or a busy machine can take a while), it is asked once more, then a message says basedpyright did not answer in time: no completion: ask again a moment later. Nothing shown is never mistaken for nothing to complete.
  • F12 (or Ctrl+click, where the terminal reports Ctrl with the mouse) goes to a definition, also into Odoo's own source; Alt+Left comes back.
  • Shift+F12 lists the references; Ctrl+F1 shows what the server knows about a name.
  • Errors and warnings are underlined, the one under the cursor is in the status line, and Window > Problems lists them.

Completion of a field type, with its documentation from Odoo's source

F12 on models.Model: its definition in Odoo Community

Shift+F12: the references to a field

Ctrl+F1 on a field type

An undefined name underlined, and Window > Problems

How Odoo is resolved

odoo comes from the Community checkout; odoo.addons.<name> resolves into Community, Enterprise and the custom folders, the first folder that has the addon winning, as in addons_path.

Odoo's ORM is dynamic, so one check is off: attribute access (a model's fields come from every addon that inherits it). Type errors stay visible: wrong arguments, assignments, return types, operators, None where a value is needed. Four Odoo idioms the analyser misreads are left out: fields.Selection([...]), _inherit = "model" as a string, records.mapped(...) passed on as a list, and an empty field's False passed where a str or an int is expected. self.env["model"] is a bare BaseModel to the server: the fields of other addons are not known there (the Odoo Models window knows them).

Clone this wiki locally