[IMP] project: add sudo in project.task write dict comprehension
All write operations on the `project.task` model are slowed down significantly by a dict comprehension mapping tasks to their user_ids because of the access rules checks. By adding a sudo to that dict comprehension, this commit makes it bypass those checks and speeds it up. Task-3164004 closes odoo/odoo#115037 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -1027,7 +1027,7 @@ class Task(models.Model):
|
||||
self = self.sudo()
|
||||
|
||||
# Track user_ids to send assignment notifications
|
||||
old_user_ids = {t: t.user_ids for t in self}
|
||||
old_user_ids = {t: t.user_ids for t in self.sudo()}
|
||||
|
||||
if "personal_stage_type_id" in vals and not vals['personal_stage_type_id']:
|
||||
del vals['personal_stage_type_id']
|
||||
|
||||
Reference in New Issue
Block a user