‘Chatter’ is one of Odolo’s communication tools which can be used for keeping a track of all the important changes or developments of a process and for real-time communication.
It also helps in facilitating internal communications within the organization. Users can write internal notes, communicate with other employees, and keep a track of all the changes. All the communication history, activities, and modifications in the forms will be shown inside the chatter.
Basically, Chatters are present in the form view of models. Based on the chatter position attribute, chatter can be seen on the right side or at the bottom of the form view.
The image below shows the chatter at the bottom of the Odoo form view.
The image below shows the chatter at the right side of the Odoo form view.
Let us see an example of how to display and use chatter in Odoo’s form view.
The image below shows a form view without the chatter.
The image below shows the XML file of the above form view.
In order to use the Chatter functionality, we will have to inherit the model’s mail. thread’ in the python file of our custom model. Also, add ‘mail’ in the dependencies in the manifest file of the custom model.
After inheriting ‘mail thread’ in the python file, we have to make changes in the XML file in order to display the chatter in the form view.
For this, we will be required to add the following code –
Request Your Free Quote
The above changes in the python and XML files will add a chatter in the form view.
In the chatter, one can see different options such as ‘Send Message’, ‘Log Note’, and ‘Add Attachments.
‘Send Message’ can notify or send messages posted in the chatter to other users by using @ symbol and selecting the required users to be notified.
‘Log Note’ can be used to record some important changes or modifications done in the form view which may be of importance in the future.
‘Add Attachments’ can add any type of attachment that may be of relevance to the existing form view.
In Odoo 15, messages can be edited or deleted from the chatter. You can click on the edit icon to edit the message and click on the delete icon for deleting the message. Confirmation will be asked before deleting the message.
Another useful feature that can be displayed in the chatter is the ‘Schedule Activity’. In order to display ‘Schedule Activity’ in the chatter, we will have to inherit the model ‘mail.activity.mixin’ in the python file of our custom model.
After making changes in the python file, modify the XML file as shown below –
The above changes will display the ‘Schedule Activity’ option in the Chatter.
Another useful feature of the Chatter is to track the form’s field value changes.
Since Odoo is a multi-user system where different users can access the same record, it’s helpful to track the changes made to the fields by users in order to identify who made that change and when it was made. In Odoo, we can track the field values, and whenever the field value changes, it will be logged in to chatter.
For example, in the above form, if we want the field ‘Age’ to be tracked, we have to add the ‘tracking=True’ parameter in the ‘age’ field in the python file.
The image below shows the ‘Age’ field as ‘23’.
Now if we change the ‘Age’ field to ‘24’ and save the record, it will be logged in the Chatter.
In this way using Odoo’s Chatter one can keep a track of all the important changes and developments which can be extremely helpful in the long run of an organization.
2 thoughts on “Add Chatter in Odoo Form View”
thanks your article really helpful to me
Thanks for sharing your valuable comments.
For More Details: https://bassaminfotech.com/request-free-quote/