O'Reilly logo

Odoo Development Essentials by Daniel Reis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

More on using inheritance to extend models

We have seen the basic in place extension of models, which is also the most frequent use of inheritance. But inheritance using the _inherit attribute has more powerful capabilities, such as mixin classes.

We also have available the delegation inheritance method, using the _inherits attribute. It allows for a model to contain other models in a transparent way for the observer, while behind the scenes each model is handling its own data.

Let's explore these possibilities in more detail.

Copying features using prototype inheritance

The method we used before to extend a model used just the _inherit attribute. We defined a class inheriting the todo.task model, and added some features to it. The class _name was ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required