[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
This commit is contained in:
@@ -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'):
|
||||
|
||||
Reference in New Issue
Block a user