Skip to content

missing-return (ODOO022)

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 that a method calling super() also has a return statement.

Why is this bad?

A method that calls super() but never returns its result (or any other value) usually means the return value of the base implementation is silently dropped.

Example

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

Use instead:

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