How to Add Chatter in Form View in Odoo 17

how to add chatter in form view in odoo

When building custom modules in Odoo, especially in versions like Odoo 17, enhancing your user interface and communication flow can make a big difference. One of the most helpful features in Odoo is Chatter, the messaging box you see in forms. Users can log notes, send messages, and track activities inside the system.

But when you create custom models, Chatter isn’t added automatically. You need to enable it manually if you want to use it in your custom form views.

This chatter functionality enhances both internal and external communications and operations. Chatter stores all communication history, activities, and modifications, which are displayed inside the chatter. Now, you might be curious about how you can add this chatter functionality to any odoo module. So here in this article, we will discuss how to add chatter in the form view in odoo 17.

But when you’re creating custom models, Chatter isn’t added automatically. If you want to use it in your custom form views, you need to enable it manually.

What is Chatter in Odoo?

Chatter is Odoo’s built-in communication widget that allows users to:

  • Post internal notes
  • Send messages
  • Log activities (like calls or meetings)
  • Track changes in the record (thanks to tracking fields)

You’ll typically see Chatter at the bottom of most form views like Sales Orders, Invoices, Projects, and Contacts.

Chatter is part of what makes Odoo powerful as a collaborative ERP. It brings transparency and helps keep communication contextual to specific business records.

Step-by-Step: How to Add Chatter in Form View (Odoo 17)

Chatter appears at the right side of the form view of models or the bottom side of the form view, depending on the position attribute.

Odoo 17 Chatter

To interact with chatter with the form view, we have to create a custom model that doesn’t have a chatter view yet.

Let’s see how to add chatter in form view.

The current form view XML looks like this as follows:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
   <record id="demo_view_form" model="ir.ui.view">
      <field name="name">demo.demo.view.form</field>
      <field name="model">demo.demo.management</field>
      <field name="arch" type="xml">
          <form>
              <header>
                  <field name="status" widget="statusbar"/>
                  <button string="Confirm" name="action_confirm"
                          type="object"/>
              </header>
              <sheet>
                  <div class="oe_title">
                      <div>
                          <label for="name"/>
                      </div>
                      <h1 class="mb32">
                          <field name="name" class="mb16"/>
                      </h1>
                  </div>
                  <group>
                      <group>
                          <field name="partner_id"/>
                          <field name="date"/>
                      </group>
                      <group>
                          <field name="status"/>
                          <field name="company_id"/>
                      </group>
                  </group>
              </sheet>
          </form>
      </field>
   </record>
</odoo>
XML

To add a chatter view inside the form view, the first and most important step is to inherit the ‘mail.thread’ model in our custom model code. Additionally, we must add a list of dependencies to the manifest file.

from odoo import fields, models


class Demo(models.Model):
    _name = 'demo.demo'
    _description = 'Demo'
    _inherit = 'mail.thread'

    name = fields.Char(string='Reference')
    partner_id = fields.Many2one('res.partner', string='Customer')
    date = fields.Date(string='Date')
    status = fields.Selection([('draft', 'Draft'), ('qualified', 'Qualified')],
                              default='draft')
    company_id = fields.Many2one('res.company',
                                 default=lambda self: self.env.company)
Python

Next, add this class oe_chatter and fields of chatter in XML like this in my above given XML code:

                   <group>
                       <field name="status"/>
                       <field name="company_id"/>
                   </group>
               </group>
           </sheet>
           <div class="oe_chatter">
               <field name="message_follower_ids" groups="base.group_user"/>
               <field name="message_ids" widget="mail_thread"/>
           </div>
       </form>
   </field>
</record>
Add Chatter in Form View in Odoo 17

Now, upgrade the module, you will be able to see the newly added chatter in the form view. Chatter provides options to send messages, mail, and also long notes, add attachments, and view followers. You can also follow the records by clicking on the follow button.

How to Add Chatter in Form View in Odoo 17

It is possible to change and remove the log notes from the lines. You can also respond with emojis, edit, and add to favorites.

Add Chatter in Form View in Odoo 17

Tracking Field Changes

In Odoo, multiple users can access the same record, making it crucial to monitor changes made to fields. Odoo offers tracking of field values, and whenever a change occurs, chatter will be notified.

For Example:

stage = fields.Selection([('draft', 'Draft'),
                          ('qualified', 'Qualified')],
                          default='draft', tracking=True)
Python

If there is a any changes in this record stage, it will be added as a log in the chatter.

what is tracking attribute in odoo

Schedule Activities from the Chatter

Based on the discussion, we can also plan activities. This requires that our custom model inherit the mail.activity.mixin model.

class TravelManagement(models.Model):
   _name = 'travel.management'
   _description = 'Travel Management'
   _inherit = ['mail.thread', 'mail.activity.mixin']
Python

After adding this, add the activity_ids field to the XML.

</sheet>
   <div class="oe_chatter">
       <field name="message_follower_ids" groups="base.group_user"/>
       <field name="activity_ids"/>
       <field name="message_ids" widget="mail_thread"/>
   </div>
</form>
XML

The Activities button has been added to Chatter after the module has been upgraded. This website allows you to create, mark as finished, modify, and cancel activities instantly.

Schedule Activities from the Chatter

Similarly, to improve traceability and communication, Chatter can be added to any form view.

Common Issues and Troubleshooting

IssueCauseFix
Chatter not showingMissing oe_chatter in form viewEnsure XML is properly structured
No tracking on changesFields missing tracking=TrueChatter is visible but inactive
Error during upgrademail not in dependenciesAdd 'mail' in __manifest__.py
Chatter visible but inactiveNo mail.thread inheritanceDouble-check _inherit on the model

Best Practices When Using Chatter

Track only important fields: Avoid overusing tracking=True, or the chatter feed will get cluttered.

Use activities strategically: Assign follow-up tasks or reviews with clear due dates.

Combine with followers: Add the right users or groups as followers so they receive updates.

Enable email notifications: Use Odoo’s email templates to notify followers about Chatter messages.

Related Post:

>> Odoo.sh VS Odoo Online VS Odoo On-Premises

>> What is Odoo ERP? 11 Reasons Why You Should Use Odoo?

Conclusion for Add Chatter in Form View in Odoo 17

Integrating Chatter into the form view of Odoo 17 significantly enhances communication, collaboration, and traceability within your business processes. By following the steps outlined, you can easily add Chatter in Form View in Odoo 17 for any custom module, enabling users to track activities, view logs, and manage records seamlessly.

Chatter not only keeps a history of interactions but also supports activity scheduling, making it an essential feature for effective record management and real-time updates. This guide demonstrates how Chatter integration can streamline workflow, ensuring that all stakeholders are informed and engaged in every stage of the record lifecycle.

Thank You.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.