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 ...

Get Odoo Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.