From 7266a268f825050aaaf4d53a55e79c33a03b0b48 Mon Sep 17 00:00:00 2001 From: Laetitia Da Costa Date: Tue, 31 Oct 2023 11:13:15 +0100 Subject: [PATCH] [IMP]project_assignees:add project manager as default assignee --- project_assignees/models/project_task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_assignees/models/project_task.py b/project_assignees/models/project_task.py index 2fda049..abc76a8 100644 --- a/project_assignees/models/project_task.py +++ b/project_assignees/models/project_task.py @@ -16,5 +16,5 @@ class Task(models.Model): project_id = vals.get('project_id', []) if project_id and assignee_ids and not assignee_ids[0][2]: project = self.env['project.project'].browse(project_id) - assignee_ids[0][2] = str(project.user_id.id) + if project and project.user_id: assignee_ids[0][2] = str(project.user_id.id) return super().create(vals) \ No newline at end of file