X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;ds=inline;f=addons%2Fproject%2Fproject.py;h=b1db7fde6b30c1bf8de7fc852589a3b711e296aa;hb=a6482fe07c57805976529eebd48225b060a9a49c;hp=6f3b23f4746cdcf1b03415beacbd560bf5e3a8f0;hpb=89e404301bdaa57dc2bbe351bfefac993ade9b38;p=odoo%2Fodoo.git diff --git a/addons/project/project.py b/addons/project/project.py index 6f3b23f..b1db7fd 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -513,13 +513,10 @@ def Project(): # OpenChatter methods and notifications # ------------------------------------------------ - def message_get_subscribers(self, cr, uid, ids, context=None): - """ Override to add responsible user. """ - user_ids = super(project, 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(project, self).message_get_follower_fields(cr, uid, ids, context=context) + return res.append('user_id') def create(self, cr, uid, vals, context=None): if context is None: context = {} @@ -1201,15 +1198,10 @@ class task(base_stage, osv.osv): result[obj.id].append(obj.user_id.id) return result - def message_get_subscribers(self, cr, uid, ids, context=None): - """ Override to add responsible user and project manager. """ - user_ids = super(task, 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) - if obj.manager_id and not obj.manager_id.id in user_ids: - user_ids.append(obj.manager_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(task, self).message_get_follower_fields(cr, uid, ids, context=context) + return res + ['user_id', 'manager_id'] def stage_set_send_note(self, cr, uid, ids, stage_id, context=None): """ Override of the (void) default notification method. """