[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:
Denis Ledoux
2016-06-09 17:27:31 +02:00
parent 8049d1e855
commit c8aac116a6
+1
View File
@@ -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