summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-10-26 08:55:44 +0000
committerNicolas Martinelli <nim@odoo.com>2020-10-26 09:13:10 +0000
commit5ee045b2532ce97094dea2fe6b5e354585d67691 (patch)
tree0c494f22c0ddd8b531a4df07236e89795548e585 /addons
parent610d5b86114dfc877a3a3650cd54cc7ec2327ab8 (diff)
[FIX] project: add follower as project user
- Create a user A with access rights to Project set as 'User' - As user A, add a follower to a task An AccessError is raised. It happens because `allowed_user_ids` has the group `project.group_project_manager`. Since a Project User is allowed to set followers on a task, it is legitimate to set the appropriate portal user as allowed. opw-2369674 closes odoo/odoo#60702 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/project/models/project.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py
index 888fa6c8b5c..da3d30dddb6 100644
--- a/addons/project/models/project.py
+++ b/addons/project/models/project.py
@@ -997,7 +997,7 @@ class Task(models.Model):
if partner_ids:
new_allowed_users = self.env['res.partner'].browse(partner_ids).user_ids.filtered('share')
tasks = self.filtered(lambda task: task.project_id.privacy_visibility == 'portal')
- tasks.write({'allowed_user_ids': [(4, user.id) for user in new_allowed_users]})
+ tasks.sudo().write({'allowed_user_ids': [(4, user.id) for user in new_allowed_users]})
return res
# ----------------------------------------