[FIX] website_project_issue: fetch the portal projects domain with sudo
The goal of this controller is to display issues that are in projects with a "portal" privacy setting. However, this setting is used by a record rule to limit access to the project to followers only; this means that you should add all the customers who submit issues to your support project. This makes no sense. To circumvent this problem, the domain of projects with this visibility setting is fetched as sudo.
This commit is contained in:
@@ -42,7 +42,9 @@ class WebsiteAccount(website_account):
|
||||
str(proj.id): {'label': proj.name, 'domain': [('project_id', '=', proj.id)]}
|
||||
})
|
||||
|
||||
domain = [('project_id.privacy_visibility','=','portal')]
|
||||
# portal users can't see the privacy_visibility, fetch the domain for them in sudo
|
||||
portal_projects = request.env['project.project'].sudo().search([('privacy_visibility', '=', 'portal')])
|
||||
domain = [('project_id', 'in', portal_projects.ids)]
|
||||
domain += project_filters.get(project, project_filters['all'])['domain']
|
||||
order = sortings.get(sortby, sortings['date'])['order']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user