OpenERP Tutorials : How to add FOLLOWERS to your custom view?

OpenERP 7 Followers

Last year at the launch of OpenERP 7.0 there was an interesting functionality included called OpenERP Followers. This function allow user to easily follow any object inside OpenERP so they can easily track their comments, tasks, contacts and changes when record moves from one stage to another.

It was an exciting feature, but a small issue was that it’s won’t display automatically for our custom views. Hence in this tutorial I’ve explained below steps through which we can include this feature inside our customized module.

  • First to add a followers for your view, you need to inherit “mail.thread” class inside your newly created object. Open your_module_name.py file and copy the following lines there,
    class your_object_name(osv.osv):
         _inherit = ['mail.thread']
         _name = 'your.object.name'
         _columns = {
              // Your list of fields
         }
    
  • After that open XML view file (your_object_name_view.xml) and just put below piece of code after tag inside FORM view of your object.
    <div class="oe_chatter">
    <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"></field>
    <field name"message_ids" widget="mail_thread"></field>
    </div>
    
  • Once that is done just login inside admin user and upgrade the module from “Settings” screen. After the successful update process you can find “Followers” panel will be added inside your custom view.

I hope you enjoyed working through this tutorial as much as I have enjoyed writing it. If you have any questions or comments, feel free to join in the discussion below!

Tags: ,

No comments yet.

Leave a Reply

sixteen − twelve =

*