Copying features with prototype inheritance

The method we used to extend the model used only the _inherit attribute. We defined a class inheriting the todo.task model and added some features to it. The class attribute _name was not explicitly set; implicitly, it was todo.task. However, using the _name attribute allows us to create a new model by copying the features from the inherited ones.

For example, we can use this to add messaging features to our To-Do tasks.

The social network module (technically name mail) provides features for a message board, found at the bottom of many document forms, as well as the logic regarding messages and notifications. This is something we will often want to add to our models, so let's learn how to do that. ...

Get Odoo 11 Development Essentials - Third Edition 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.