From c54824dfee24c08c62d1e8a60f09710e40b675cc Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Tue, 25 Feb 2020 09:05:02 +0000 Subject: [PATCH] [IMP] website_forum: hide negative karma posts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently posts are hidden at the post level only (by giving a 404). The posts are still visible in the list of posts on the main forum page. Now we hide the posts of users with negative amount of karma. task-2093636 closes odoo/odoo#46194 Signed-off-by: Jérémy Kersten (jke) --- addons/website_forum/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index dfac6dc75a9..b309a644be0 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -90,7 +90,7 @@ class WebsiteForum(WebsiteProfile): Post = request.env['forum.post'] - domain = [('forum_id', '=', forum.id), ('parent_id', '=', False), ('state', '=', 'active')] + domain = [('forum_id', '=', forum.id), ('parent_id', '=', False), ('state', '=', 'active'), ('can_view', '=', True)] if search: domain += ['|', ('name', 'ilike', search), ('content', 'ilike', search)] if tag: