[MERGE]: Merged lp:~openerp-dev/openobject-addons/trunk-auto_follow-atp-sales_auto_follow-pja

bzr revid: atp@tinyerp.com-20120924125139-uaw26laihpyk4u7o
This commit is contained in:
Atul Patel (OpenERP)
2012-09-24 18:21:39 +05:30
6 changed files with 25 additions and 16 deletions
+4 -8
View File
@@ -1098,17 +1098,13 @@ class task(base_stage, osv.osv):
}, context=context)
return True
def project_message_followers(self, cr, uid, task_id, context=None):
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
if project_id:
followers = [follower.id for follower in project_obj.browse(cr, uid, project_id.id, context=context).message_follower_ids]
self.message_subscribe(cr, uid, task_id, followers, context=context)
return True
def create(self, cr, uid, vals, context=None):
task_id = super(task, self).create(cr, uid, vals, context=context)
self.project_message_followers(cr, uid, task_id, context=context)
followers = [follower.id for follower in project_id.message_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