Odoo OpenERP – Adding followers to your newly created object

Odoo OpenERP – Adding followers to your newly created object

 

The Social Network module in Odoo / OpenERP introduces a messaging system based on a subscription mechanism. You might have come across this feature where there is a concept of followers on many screens. A user can follow a particular record, and after doing so, the user can have communication with all of the related persons of that transaction. A user can follow multiple transactions in modules such as Purchase Order, Sales Order, Project Management, etc…

 


Odoo OpenERP – Adding followers to your newly created object.

 

In order to add followers into our own object,we have to inherit mail.thread into our class. There is no need to add any extra column in class. Please find following example which will explain the concept clearly. Please add these lines to .py file.

 

class class_name(osv.osv):

_name = “class.name”

_inherit = [‘mail.thread’]

_description = “Name Of The Class”

_columns = {

}

 

Also in form view, we have to add lines as follow.

 

<div class=”oe_chatter”>
<field name=”message_follower_ids” widget=”mail_followers” groups=”base.group_user”/>
<field name=”message_ids” widget=”mail_thread”/>
</div>

lines after </sheet> tag and the functionality of “Following” will appear in our object.

 

Hope you find this useful.

Odoo_following

 

To find out more about Odoo, call Nevpro Business Solutions on (022) 6673 6577 or write to us at [email protected].