summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2016-06-09 18:24:12 +0200
committerDenis Ledoux <dle@odoo.com>2016-06-09 18:26:06 +0200
commitd6e93d063b2fc630c3fb9db6c52e9656d8410cff (patch)
tree79c0b1505bfb56b5cb3e0cb2d6e95c84d796ccbd
parent291561a19741f81cdd2c6ba42a228f02d670c24e (diff)
[FIX] project: project duplicate message followers
This is related to revision c8aac116a688a83050bb88bd5a5eed07eb895138 `message_follower_ids` is a one2many field on the thread. To copy them, you must create new `mail.followers` records, and not linking the followers of the project being duplicated to the duplicated project.
-rw-r--r--addons/project/project.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/project/project.py b/addons/project/project.py
index 2a56f437c6b..f3b4c4c7f28 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -255,8 +255,9 @@ class project(osv.osv):
proj = self.browse(cr, uid, id, context=context)
if not default.get('name'):
default.update(name=_("%s (copy)") % (proj.name))
- default['message_follower_ids'] = [(6, 0, proj.message_follower_ids.ids)]
res = super(project, self).copy(cr, uid, id, default, context)
+ for follower in proj.message_follower_ids:
+ self.message_subscribe(cr, uid, res, partner_ids=[follower.partner_id.id], subtype_ids=[subtype.id for subtype in follower.subtype_ids])
self.map_tasks(cr, uid, id, res, context=context)
return res