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 yourodools.toml configuration:
| Severity | Description |
|---|---|
Error | Shown as a red underline; indicates a definite problem. |
Warning | Shown as a yellow underline; indicates a potential problem. |
Info | Shown as a blue underline; informational only. |
Hint | Subtle hint-level annotation; lightest visible level. |
Disabled | Suppresses the diagnostic entirely for the configured scope. |
Common diagnostics
OLS03001 — Model not in module dependencies
OLS03001 — Model not in module dependencies
You are accessing a model (via Fix: Add the module that declares
self.env["model.name"] or @api.returns) that is not declared in the depends list of your module’s __manifest__.py.sale.order to your manifest’s depends list.OLS03002 — Unknown model
OLS03002 — Unknown model
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.
OLS03011 — Invalid search domain field
OLS03011 — Invalid search domain field
A field name used in a search domain is not a member of the model being searched, or the dot-notation chain is invalid.
OLS04010 — Missing module dependency
OLS04010 — Missing module dependency
A module listed in the
depends key of __manifest__.py could not be found in the configured addon paths.OLS05001 — Unknown XML ID
OLS05001 — Unknown XML ID
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.Configuring diagnostics
Override severity per code
Add a[config.diagnostic_settings] table to your odools.toml to change the severity of specific codes:
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.
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):
Missing import diagnostics
Thediag_missing_imports setting controls when import-related diagnostics (OLS02xxx) are emitted:
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.