Manifest Academy

Home › Curriculum › Odoo Developer › Inheritance: extension, prototype and delegation; overriding methods

Business logic and automation · 16 min · 17–20

Inheritance: extension, prototype and delegation; overriding methods

The three inheritance mechanisms, overriding create, write, unlink and business methods correctly.

In this lesson

Key points

Real-world example

A module copied the whole _prepare_invoice method to add one field. When Odoo changed that method's internals in a minor update, invoices lost their fiscal position silently. Replacing the copy with a super() call that added the field to the returned dict fixed it and survived the next upgrade.

Questions and answers

What does @api.ondelete(at_uninstall=False) do?

Runs a check before unlink that's skipped when the module is being uninstalled.

Which model uses delegation to res.partner?

res.users (and others like res.company).

Read the full lesson, worked example and quiz