Skip to content

Settings

Options read by the ODOO rules. Every other Ruff option is documented at docs.astral.sh/ruff/settings.

lint.odoo

Options for the odoo plugin.

category-allowed

A list of categories allowed in a module's manifest (ODOO065). While the list is empty the rule is inert, so a project only opts in by naming its categories.

Default value: []

Type: list[str]

Example usage:

=== "pyproject.toml"

```toml
[tool.ruff.lint.odoo]
# Only these categories may appear in a manifest.
category-allowed = ["Accounting", "Sales", "Warehouse"]
```

=== "ruff.toml"

```toml
[lint.odoo]
# Only these categories may appear in a manifest.
category-allowed = ["Accounting", "Sales", "Warehouse"]
```

odoo-required-files

A list of files every Odoo module must ship (ODOO066), as paths relative to the module directory. While the list is empty the rule is inert.

Default value: []

Type: list[str]

Example usage:

=== "pyproject.toml"

```toml
[tool.ruff.lint.odoo]
# Every module must have a description page.
odoo-required-files = ["static/description/index.html"]
```

=== "ruff.toml"

```toml
[lint.odoo]
# Every module must have a description page.
odoo-required-files = ["static/description/index.html"]
```

odoo-version

The targeted Odoo version, used to suppress rules that only apply to a specific range of Odoo versions (e.g. deprecated-self-cr only applies since 19.0).

Default value: null

Type: str

Example usage:

=== "pyproject.toml"

```toml
[tool.ruff.lint.odoo]
# Target Odoo 17.0.
odoo-version = "17.0"
```

=== "ruff.toml"

```toml
[lint.odoo]
# Target Odoo 17.0.
odoo-version = "17.0"
```

prohibited-override-methods

A list of method names whose override is prohibited (ODOO055). A method counts as an override when its body delegates to super().<method>(...).

Default value: []

Type: list[str]

Example usage:

=== "pyproject.toml"

```toml
[tool.ruff.lint.odoo]
# Flag overrides of `action_post`.
prohibited-override-methods = ["action_post"]
```

=== "ruff.toml"

```toml
[lint.odoo]
# Flag overrides of `action_post`.
prohibited-override-methods = ["action_post"]
```