Skip to content

method-required-super (ODOO005)

Preview (since 0.16.2.1) · 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 that common Odoo ORM methods (create, write, unlink, ...) call super() somewhere in their body.

Why is this bad?

Overriding one of these methods without calling super() usually means the base implementation (and any other module's override in the resolution order) never runs, silently breaking the inheritance chain.

Example

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

    def write(self, vals):
        return True

Use instead:

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

    def write(self, vals):
        return super().write(vals)