[WIP] Followers rewrite: in create/write, the purpose is to add the field in the...
[odoo/odoo.git] / addons / crm / crm_lead.py
index 6e1d3a7..6b29dbb 100644 (file)
@@ -859,13 +859,10 @@ class crm_lead(base_stage, osv.osv):
     # OpenChatter methods and notifications
     # ----------------------------------------
 
-    def message_get_subscribers(self, cr, uid, ids, context=None):
-        """ Override to add the salesman. """
-        user_ids = super(crm_lead, self).message_get_subscribers(cr, uid, ids, context=context)
-        for obj in self.browse(cr, uid, ids, context=context):
-            if obj.user_id and not obj.user_id.id in user_ids:
-                user_ids.append(obj.user_id.id)
-        return user_ids
+    def message_get_follower_fields(self, cr, uid, ids, context=None):
+        """ Override to add 'user_id' field to automatic subscription. """
+        res = super(crm_lead, self).message_get_follower_fields(cr, uid, ids, context=context)
+        return res.append('user_id')
 
     def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
         """ Override of the (void) default notification method. """