[FIX] website_forum: access right issue on validation queue

- If you are a portal user when trying to access the validation queue
an access right error can be triggered when trying to read the post's
user name if the record rules don't let you read on this specific
user.

closes odoo/odoo#33626

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
This commit is contained in:
Toufik Ben Jaa
2019-05-23 15:03:17 +00:00
parent 4ae4af623d
commit ea92ce6018
+3 -3
View File
@@ -439,7 +439,7 @@ class WebsiteForum(WebsiteProfile):
values = self._prepare_user_values(forum=forum)
values.update({
'posts_ids': posts_to_validate_ids,
'posts_ids': posts_to_validate_ids.sudo(),
'queue_type': 'validation',
})
@@ -459,7 +459,7 @@ class WebsiteForum(WebsiteProfile):
values = self._prepare_user_values(forum=forum)
values.update({
'posts_ids': flagged_posts_ids,
'posts_ids': flagged_posts_ids.sudo(),
'queue_type': 'flagged',
'flagged_queue_active': 1,
})
@@ -478,7 +478,7 @@ class WebsiteForum(WebsiteProfile):
values = self._prepare_user_values(forum=forum)
values.update({
'posts_ids': offensive_posts_ids,
'posts_ids': offensive_posts_ids.sudo(),
'queue_type': 'offensive',
})