Skip to content
Snippets Groups Projects
Commit 5ee045b2 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 610d5b86
No related branches found
No related tags found
No related merge requests found
......@@ -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
# ----------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment