'copy and map tasks from old to new project'

@api.multi
def map_tasks(self, new_project_id):

    tasks = self.env['project.task']
    for task in self.tasks:
        defaults = {'stage_id': task.stage_id.id, 'name': task.name}
        tasks += task.copy(defaults)
    return self.browse(new_project_id).write({'tasks': [(6, 0, tasks.ids)]})
