Skip to content

method-inverse (ODOO029)

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 the method name passed to a field's inverse= argument starts with _inverse_.

Why is this bad?

The _inverse_<field> prefix is the Odoo naming convention for inverse methods.

Example

total = fields.Float(inverse="_set_total")

Use instead:

total = fields.Float(inverse="_inverse_total")