[IMP] improve code.
bzr revid: nco@tinyerp.com-20120924111449-ovy2a2bel0vn6jm6
This commit is contained in:
@@ -1100,10 +1100,9 @@ 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
|
||||
if project_id:
|
||||
follower_ids = project_obj.browse(cr, uid, project_id.id, context=context).message_follower_ids
|
||||
follower_ids = self.pool.get("project.project").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)
|
||||
|
||||
@@ -381,9 +381,8 @@ class project_issue(base_stage, osv.osv):
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
obj_id = super(project_issue, self).create(cr, uid, vals, context=context)
|
||||
project_obj = self.pool.get("project.project")
|
||||
project_id = self.browse(cr, uid, obj_id, context=context).project_id
|
||||
follower_ids = project_obj.browse(cr, uid, project_id.id, context=context).message_follower_ids
|
||||
follower_ids = self.pool.get("project.project").browse(cr, uid, project_id.id, context=context).message_follower_ids
|
||||
followers = [follower.id for follower in follower_ids]
|
||||
self.message_subscribe(cr, uid, obj_id, followers, context=context)
|
||||
self.create_send_note(cr, uid, [obj_id], context=context)
|
||||
|
||||
Reference in New Issue
Block a user