[FIX] project: project duplicate message followers

This is related to revision
c8aac116a6

`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.
This commit is contained in:
Denis Ledoux
2016-06-09 18:26:06 +02:00
parent 291561a197
commit d6e93d063b
+2 -1
View File
@@ -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