method-compute (C8108)#

A field’s compute method is not named _compute_....

What it does#

Checks that the method a field names in compute= starts with _compute_.

Why is this bad?#

The OCA naming convention makes the purpose of a method clear without looking up the field that uses it.

Example#

total = fields.Float(compute="get_total")

Use instead:

total = fields.Float(compute="_compute_total")