[FIX] project: duplicate project must copy followers
Since duplicating a project copies the project tasks, with the followers, the project followers must remain as well. This is done in the already overriden method `copy` instead of simply adding `copy=True` on the according one2many field, since this field is defined on the inherited model `mail.thread`, and to add `copy=True`, in the old api, we would have to re-define the `message_follower_ids` field within the `project.project` model completely, making sure to copy all properties opw-680313
This commit is contained in:
@@ -255,6 +255,7 @@ 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)
|
||||
self.map_tasks(cr, uid, id, res, context=context)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user