Manifest Academy

Home › Curriculum › Technical Foundations › Classes, inheritance, decorators and comprehensions

Python for Odoo · 16 min · Python 3.12

Classes, inheritance, decorators and comprehensions

Object-oriented Python as Odoo uses it: classes, attributes, methods, super(), decorators and comprehensions.

In this lesson

Key points

Real-world example

A developer overrode action_confirm without returning super()'s result. Confirming from the form worked, but a website flow expecting an action dictionary broke silently. Adding 'return res' fixed it, and the team added 'always return super()' to their code-review checklist.

Questions and answers

What does filtered() take?

A function (often a lambda) returning truthy for records to keep, or a field name string.

What is a decorator?

A function that wraps another function to change or extend its behaviour.

Read the full lesson, worked example and quiz