[ADD] followers of the project are auto follower of task

bzr revid: nco@tinyerp.com-20120924073347-dotwb5mifv4r7ap6
This commit is contained in:
Nimesh (Open ERP)
2012-09-24 13:03:47 +05:30
parent 921661b4e8
commit 76a1fc90e9
+7
View File
@@ -1100,6 +1100,13 @@ class task(base_stage, osv.osv):
def create(self, cr, uid, vals, context=None):
task_id = super(task, self).create(cr, uid, vals, context=context)
project_obj = self.pool.get("project.project")
project_id = self.browse(cr, uid, task_id, context=context).project_id
print "project_id"
if project_id:
follower_ids = project_obj.browse(cr, uid, project_id.id, context=context).message_follower_ids
followers = [follower.id for follower in follower_ids]
self.message_subscribe(cr, uid, task_id, followers, context=context)
self._store_history(cr, uid, [task_id], context=context)
self.create_send_note(cr, uid, [task_id], context=context)
return task_id