From 08ecf62d0c1078e44188e176fd57365af73dd0f8 Mon Sep 17 00:00:00 2001 From: "Hugo Carlier (Huca)" Date: Thu, 16 Mar 2023 10:42:16 +0100 Subject: [PATCH] [IMP] project: avoid to add OdooBot as default assignee on tasks During the creation of a private task (model project.task with not project_id set), the current user is added as assignee. For all the demo data, OdooBot is therefore added as a default assignee. This commit avoid this situation by performing a check on user id at creation of a private task. task-3085077 --- addons/project/models/project_task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py index 4a8b9d12a1e..9af5933e743 100644 --- a/addons/project/models/project_task.py +++ b/addons/project/models/project_task.py @@ -897,7 +897,7 @@ class Task(models.Model): vals['date_assign'] = fields.Datetime.now() if not project_id: user_ids = self._fields['user_ids'].convert_to_cache(vals.get('user_ids', []), self) - if self.env.user.id not in user_ids: + if self.env.user.id not in list(user_ids) + [SUPERUSER_ID]: vals['user_ids'] = [Command.set(list(user_ids) + [self.env.user.id])] # Stage change: Update date_end if folded stage and date_last_stage_update if vals.get('stage_id'):