In Odoo, chatter is used as an effective tool for collaborative work inside records. Using internal notes and tracking options, enrich your internal and external communications and streamlines operations with colleagues and partners. Inside chatter, all communication history, activity, and changes will be displayed.
Chatters are present in the form view of models. Depending on the screen resolution, they will be on the right side or at the bottom of the form view.
So, let’s discuss how to add chatter in the form view. Here, I have a custom model, and currently, I haven't added the chatter view. So it will look like this,
And the code will look like this.
In order to add a chatter view, as a first and important step, we have to inherit the mail. thread model to our custom model. And add mail to the dependent list in the manifest.
Also, add class and fields of chatter in XML like this.
After upgrading the module, you will be able to see the newly added chatter in the form view.
There are options to send messages, add log notes, add attachments, view followers, and also an option to follow just by clicking the follow button.
You can edit and delete the log notes from the lines by itself. Also, there is an option to edit, react with emojis, and add to favorites.
Tracking fields changes
Odoo allows several users to access the same record. Thus it's important to keep track of the changes that users make to the fields. We can keep track of the field values in Odoo, and every time one changes, Chatter will be notified.
For example, I have added tracking for the stage.
If there is a change in the record status, it will be added as log. So, like this, we can add tracking to the field changes.
Schedule activities from the chatter
From the chatter, we can also schedule activities. For that, we have to inherit the mail.activity.mixin model to our custom model.
After that, add the activity_ids field to the XML.
After upgrading the module, we can see the Activities button is added to the chatter. So, from here, we can directly create, mark as done, edit, and cancel the activities.
Like this, we can add chatter to any form view.