O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

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

Adding features to a Model using inheritance

One of the most important Odoo features is the ability of module addons extending features defined in other module addons without having to edit the code of the original feature. This might be to add fields or methods, or modify existing fields, or extend existing methods to perform additional logic.

It is the most frequently used method of inheritance and is referred to by the official documentation as traditional inheritance or classical inheritance.

We will extend the built in Partner model to add it to a computed field with the authored book count. This involves adding a field and a method to an existing model.

Getting ready

We will reuse the my_module addon module from Chapter 3, Creating Odoo Modules ...

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