Skip to main content
OdooLS supports multiple profiles in a single odools.toml file. Each [[config]] section defines one profile. Profiles can inherit from each other, merge or override array fields, and use path variables to auto-detect version information from the workspace.

Profile basics

Every profile has a name field. The built-in fallback profile is always named "default".
[[config]]
name = "default"
odoo_path = "/opt/odoo/17.0"
addons_paths = ["/opt/odoo/17.0/addons"]
python_path = "python3"
When OdooLS finds an odools.toml, it loads all profiles and makes them available. Non-abstract profiles are all applied to the session simultaneously.

Inheritance with extends

A profile can inherit every field from another profile using the extends key. Child settings override parent settings for scalar fields.
[[config]]
name = "base"
odoo_path = "/opt/odoo"
python_path = "python3"
diag_missing_imports = "only_odoo"

[[config]]
name = "v17"
extends = "base"
odoo_path = "/opt/odoo/17.0"
addons_paths = ["/opt/odoo/17.0/addons", "/opt/custom/17.0"]

[[config]]
name = "v16"
extends = "base"
odoo_path = "/opt/odoo/16.0"
addons_paths = ["/opt/odoo/16.0/addons", "/opt/custom/16.0"]
In this example, v17 and v16 both inherit python_path and diag_missing_imports from base but each have their own odoo_path and addons_paths.
Circular extends chains are detected and rejected with an error at startup.

Abstract profiles

A profile with abstract = true is a template: it contributes settings to child profiles via extends but is not itself activated as a working configuration.
[[config]]
name = "base"
python_path = "python3"
diag_missing_imports = "only_odoo"
abstract is a computed flag — OdooLS sets it automatically on profiles that use ${splitVersion} (see below). You do not normally set it manually in your config file.

Merging array fields

Two fields control how array values from a parent profile are combined with the child’s values:
FieldDefaultBehaviour
addons_merge"merge"Append parent addons_paths to the child’s list
additional_stubs_merge"merge"Append parent additional_stubs to the child’s list
Set either to "override" to ignore the parent’s values entirely.
[[config]]
name = "v17"
extends = "base"
addons_merge = "override"   # use only the paths listed below
addons_paths = ["/opt/odoo/17.0/addons"]

The $version variable

$version lets you set a version string that can be referenced in path fields. OdooLS expands $version wherever it appears in other field values. Three ways to supply a version:
  1. Literal string — provide the version directly.
    $version = "17.0"
    odoo_path = "/opt/odoo/$version"
    
  2. Path to __manifest__.py — OdooLS reads the "version" key and extracts the major.minor portion.
    $version = "/opt/odoo/custom_addons/my_module/__manifest__.py"
    
  3. ${splitVersion} suffix — OdooLS scans the parent directory for subdirectories whose names match a major.minor version pattern and creates one derived profile per version found. The parent profile is automatically marked abstract.
    $version = "/opt/odoo/${splitVersion}"
    odoo_path = "/opt/odoo/$version"
    addons_paths = ["/opt/odoo/$version/addons"]
    
    With directories /opt/odoo/16.0/ and /opt/odoo/17.0/ present, OdooLS generates two concrete profiles: default-16.0 and default-17.0.

The $base variable and ${detectVersion}

$base sets a base path variable that can be reused across multiple fields. Its most powerful use is the ${detectVersion} suffix, which tells OdooLS to match the workspace folder path against the prefix before ${detectVersion} and extract the next path component as the version.
[[config]]
name = "auto"
$base = "/opt/odoo/${detectVersion}"
odoo_path = "$base"
addons_paths = ["$base/addons"]
1

Workspace path is matched

OdooLS checks whether the workspace folder is inside /opt/odoo/.
2

Version component is extracted

The directory component immediately after /opt/odoo/ (for example 17.0) becomes $version.
3

Variables are expanded

$base resolves to /opt/odoo/17.0, and odoo_path and addons_paths follow automatically.
Use ${detectVersion} when your team opens workspace folders directly inside a versioned Odoo installation, such as /opt/odoo/17.0/custom_addons.

Supported path variables

The following template variables are supported in path fields:
VariableDescription
${workspaceFolder:NAME}Absolute path of the workspace folder named NAME
${userHome}Current user’s home directory
$versionResolved version string (set by $version or auto-detected)
$baseResolved base path (set by $base)
$autoDetectAddonsSpecial value in addons_paths; replaced by the workspace folder if it is a valid addon directory

Multi-version example

The example below shows a complete multi-version setup using explicit inheritance:
[[config]]
name = "base"
odoo_path = "/opt/odoo"
python_path = "python3"
diag_missing_imports = "only_odoo"

[[config]]
name = "v17"
extends = "base"
odoo_path = "/opt/odoo/17.0"
addons_paths = ["/opt/odoo/17.0/addons", "/opt/custom/17.0"]

[[config]]
name = "v16"
extends = "base"
odoo_path = "/opt/odoo/16.0"
addons_paths = ["/opt/odoo/16.0/addons", "/opt/custom/16.0"]
And the same setup using ${detectVersion} for automatic version detection:
[[config]]
name = "auto"
$base = "/opt/odoo/${detectVersion}"
odoo_path = "$base"
addons_paths = ["$base/addons", "$autoDetectAddons"]
python_path = "python3"
diag_missing_imports = "only_odoo"

Build docs developers (and LLMs) love