How to add Chatter to an existing model

A recent issue that I have faced with was adding chatter to the hr.job model. I have found the solution on the Official Odoo Forum and I want to share it with you.

The thing is that you need to inherit the model mail.thread but also to redefine the name of the existing model. In my case it looks like:

class HrJob(models.Model):
    _name = 'hr.job'
    _inherit = ['hr.job', 'mail.thread']

Additionally, one more thing that needs to be done is to update the form view:

<xpath expr="//field[@name='message_follower_ids']" position="after"> 
    <field name="message_ids" widget="mail_thread"/>
</xpath>
Share the knowledge!

1 Comments

Leave a Reply

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