no-write-in-compute (ODOO040)
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 self.write(...) calls inside compute methods.
Why is this bad?
Writing from a compute method triggers the full write path (constraints, recomputes,
audit fields) and can recurse; assigning via update (or plain field assignment) is the
supported way to set values from a compute.
Example
Use instead: