Manifest Academy

Home › Curriculum › Odoo Developer › Computed fields, related fields, onchange and constraints

The ORM · 18 min · 17–20

Computed fields, related fields, onchange and constraints

@api.depends computations, store and search, inverse, related fields, onchange, Python and SQL constraints.

In this lesson

Key points

Real-world example

A non-stored computed 'margin %' on sales orders couldn't be grouped in a pivot, so the director's report was empty. Making it stored with correct @api.depends on line costs and prices fixed the report; a migration recomputed it for 60,000 historical orders overnight.

Questions and answers

How do you make a related field groupable?

store=True.

What replaced name_get in Odoo 17+?

_compute_display_name (display_name computed field).

Read the full lesson, worked example and quiz