Skip to content

deprecated-odoo-model-method (ODW8160)

Preview (since 0.16.2.2) · Related issues · View source

Derived from the odoo linter.

This rule is unstable and in preview. The --preview flag is required for use.

What it does

Checks for overrides of model methods that Odoo has deprecated (e.g. fields_view_get, removed in 16.0).

Why is this bad?

Overriding a method the ORM no longer calls means the override silently never runs.

Example

def fields_view_get(self, view_id=None, view_type="form", **kwargs): ...

Since Odoo 18.0 the access checks are one such case. check_access_rights and its siblings used to be the extension points; the single hook _check_access replaced them, so an override of the old names is dead code:

def check_access_rights(self, operation, raise_exception=True): ...

Use instead:

def _check_access(self, operation): ...

Options

Setting it drops the version gating the built-in list carries.