[FIX] project: merge tasks should be filled automatically.
With the new views, the merge task feature did not properly precomplete the selected tasks. This is because they do not support the command 4 when creating a new record. This will be fixed at some point, but meanwhile, we can just simply return the selected ids in the default_get. This makes the code slightly simpler. (PR #17566, issue 746867)
This commit is contained in:
@@ -63,7 +63,7 @@ class ProjectTaskMergeWizard(models.TransientModel):
|
||||
selected_tasks = self.env['project.task'].browse(self.env.context.get('active_ids', False))
|
||||
assigned_tasks = selected_tasks.filtered(lambda task: task.user_id)
|
||||
result.update({
|
||||
'task_ids': [(4, task.id) for task in selected_tasks],
|
||||
'task_ids': selected_tasks.ids,
|
||||
'user_id': assigned_tasks and assigned_tasks[0].user_id.id or False,
|
||||
'target_project_id': selected_tasks[0].project_id.id,
|
||||
'target_task_id': selected_tasks[0].id
|
||||
|
||||
Reference in New Issue
Block a user