One of Odoo's most powerful feature is the ability to add features without directly modifying the underlying objects.

This is achieved through inheritance mechanisms, functioning as modification layers on top of existing objects. These modifications can happen at all levels: models, views, and business logic. Instead of directly modifying an existing module, we create a new module to add the intended modifications.

In this chapter, you will learn how to write your own extension modules, empowering you to leverage the existing core or community applications. As a relevant example, you will learn how to add Odoo's social and messaging features to your own modules.

Our To-Do application now allows users to privately manage their own to-do tasks. Won't it be great to take the app to another level by adding collaboration and social networking features to it? We will be able to share tasks and discuss them with other people.

We will do this with a new module to extend the previously created To-Do app and add these new features using the inheritance mechanisms. Here is what we expect to achieve by the end of this chapter:

Adding sharing capabilities to the To-Do app

This will be our work plan for the feature extensions to be implemented:

We will start creating the basic skeleton for a new todo_user module alongside the todo_app module. Following the installation example in Chapter 1 , Getting Started with Odoo Development, we are hosting our modules at ~/odoo-dev/custom-addons/. We should add there a new todo_user directory for the module, containing an empty __init__.py file.

Now create todo_user/__manifest__.py, containing this code:

{  'name': 'Multiuser To-Do', 
   'description': 'Extend the To-Do app to multiuser.', 
   'author': 'Daniel Reis', 
   'depends': ['todo_app'], } 

We haven't done this here, but including the summary and category keys can be important when publishing modules to the Odoo online app store.

Notice that we added the explicit dependency on todo_app module. This is necessary and important for the inheritance mechanism to work properly. And from now on, when the todo_app  module is updated, all modules depending on it, such as todo_user module, will also be updated.

Next, install it. It should be enough to update the module list using the Update  Apps  List menu option under Apps; find the new module in the Apps list and click on its Install button. Note that this time you will need to remove the default Apps filter in order to see the new module in the list, since it is not flagged as being an application. For more detailed instructions on discovering and installing a module, refer to Chapter 1 , Getting Started with Odoo Development.

Now, let's start adding new features to it.