Skip to main content
OdooLS reports diagnostics as you type — no build step required. Problems are surfaced directly in your editor’s Problems panel and as inline squiggles. Diagnostic codes follow the format OLS<section><number> and are grouped into five sections by the kind of problem they detect.

Diagnostic categories

OLS01xxx — Python / Syntax

Covers Python-level problems: parse errors, wrong argument counts, unexpected keyword arguments, missing keyword-only arguments, invalid super() usage, and non-static methods that are missing a self or cls parameter.

OLS02xxx — Imports

Reports missing imports and symbols that OdooLS cannot evaluate — for example, when a circular import chain breaks the resolution flow. Controlled by the diag_missing_imports setting.

OLS03xxx — Odoo / Models

Odoo-specific checks: model not in module dependencies, unknown models, invalid field inheritance, domain validation (structure, operators, field names), relational field comodel checks, deprecation warnings (OLS033xx sub-range), and more.

OLS04xxx — Manifests

Validates __manifest__.py files: structural problems, duplicate keys, invalid dependency declarations, self-dependency, and cyclic module dependencies.

OLS05xxx — XML / CSV

Validates Odoo data files: XML parse errors, unknown XML IDs, unspecified modules, invalid node structure, invalid attributes, and data file path checks.

Severity levels

Each diagnostic code has a default severity. You can override any code in your odools.toml configuration:
SeverityDescription
ErrorShown as a red underline; indicates a definite problem.
WarningShown as a yellow underline; indicates a potential problem.
InfoShown as a blue underline; informational only.
HintSubtle hint-level annotation; lightest visible level.
DisabledSuppresses the diagnostic entirely for the configured scope.

Common diagnostics

You are accessing a model (via self.env["model.name"] or @api.returns) that is not declared in the depends list of your module’s __manifest__.py.
# In module 'my_module' whose manifest does not depend on 'sale'
order = self.env["sale.order"]  # OLS03001
Fix: Add the module that declares sale.order to your manifest’s depends list.
The model string you used does not correspond to any model OdooLS has indexed. This usually means the module declaring the model is not in your configured addon paths.
partner = self.env["res.prtnr"]  # OLS03002 — typo or missing addon path
A field name used in a search domain is not a member of the model being searched, or the dot-notation chain is invalid.
domain = [("nonexistent_field", "=", True)]  # OLS03011
A module listed in the depends key of __manifest__.py could not be found in the configured addon paths.
# __manifest__.py
{
    "depends": ["base", "typo_module"],  # OLS04010
}
A ref attribute in an XML data file points to an XML ID that has not been declared in this module or any of its dependencies.
<field name="group_id" ref="base.group_typo"/>  <!-- OLS05001 -->

Configuring diagnostics

Override severity per code

Add a [config.diagnostic_settings] table to your odools.toml to change the severity of specific codes:
[config.diagnostic_settings]
OLS03001 = "Disabled"   # suppress model-dependency warnings entirely
OLS02001 = "Warning"    # downgrade missing-import errors to warnings
OLS03002 = "Info"       # treat unknown-model errors as informational

Suppress diagnostics by path pattern

Use [[config.diagnostic_filters]] to suppress specific codes for files matching a path glob. This is useful for test directories where model-dependency rules are intentionally relaxed.
[[config.diagnostic_filters]]
paths = ["**/tests/**"]
codes = ["OLS03.*"]
path_type = "in"   # suppress these codes FOR files matching the path
Set path_type = "not_in" to suppress the codes for files that do not match the path pattern instead. Path patterns support the variables ${userHome} and ${workspaceFolder:NAME} (where NAME is the workspace folder name):
[[config.diagnostic_filters]]
paths = ["${workspaceFolder:my_module}/tests/**"]
codes = ["OLS03001", "OLS03002"]
path_type = "in"

Missing import diagnostics

The diag_missing_imports setting controls when import-related diagnostics (OLS02xxx) are emitted:
[[config]]
diag_missing_imports = "all"       # default — report all missing imports
# diag_missing_imports = "only_odoo" # only report imports from the Odoo namespace
# diag_missing_imports = "none"      # never report missing imports
The diag_missing_imports setting is particularly useful when your environment has third-party packages that OdooLS cannot index. Setting it to only_odoo keeps import diagnostics focused on Odoo modules while ignoring external library imports.

Full code reference

For a complete list of every diagnostic code, its default severity, and an explanation of what triggers it, see the Diagnostics Overview.

Build docs developers (and LLMs) love