Skip to content

super-method-mismatch (ODOO036)

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 super().other_method() calls where the method called on super() differs from the enclosing method's own name.

Why is this bad?

Calling a different method on super() is usually a copy-paste mistake; when it's intentional, it tends to surprise readers and break cooperative multiple inheritance.

Example

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

Use instead:

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