Skip to content

attribute-deprecated (ODOO021)

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 assignments to deprecated old-API attributes (_columns, _defaults, length) on Odoo model classes.

Why is this bad?

These attributes belonged to the old Odoo ORM API and have no effect in the current API.

Example

class MyModel(models.Model):
    _inherit = "my.model"

    _defaults = {"active": True}