From b62f5081aab170bb132e28890854c8113697accc Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Wed, 28 Jun 2023 06:10:15 +0000 Subject: [PATCH] [IMP] website_forum: show popover info only for public profile before this commit, even it the user profile is not public, or if the user karma is less than karma_profile_min set in the website, on hovering the move on the user image in the post, the user details is shown in the pop over after this commit, the pop over information is shown only if the user's profile is public profile and user karma is greater than karma_profile_min in website closes odoo/odoo#126628 Signed-off-by: Thibault Delavallee (tde) --- addons/website_forum/models/forum_post.py | 2 +- addons/website_forum/views/forum_forum_templates_tools.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_forum/models/forum_post.py b/addons/website_forum/models/forum_post.py index c5c1e6b33c5..a3ea7410731 100644 --- a/addons/website_forum/models/forum_post.py +++ b/addons/website_forum/models/forum_post.py @@ -260,7 +260,7 @@ class Post(models.Model): post.can_comment = is_admin or user.karma >= post.karma_comment post.can_comment_convert = is_admin or user.karma >= post.karma_comment_convert post.can_view = is_admin or user.karma >= post.karma_close or (post_sudo.create_uid.karma > 0 and (post_sudo.active or post_sudo.create_uid == user)) - post.can_display_biography = is_admin or post_sudo.create_uid.karma >= post.forum_id.karma_user_bio + post.can_display_biography = is_admin or (post_sudo.create_uid.karma >= post.forum_id.karma_user_bio and post_sudo.create_uid.website_published) post.can_post = is_admin or user.karma >= post.forum_id.karma_post post.can_flag = is_admin or user.karma >= post.forum_id.karma_flag post.can_moderate = is_admin or user.karma >= post.forum_id.karma_moderate diff --git a/addons/website_forum/views/forum_forum_templates_tools.xml b/addons/website_forum/views/forum_forum_templates_tools.xml index edd78291a7c..38c4505a132 100644 --- a/addons/website_forum/views/forum_forum_templates_tools.xml +++ b/addons/website_forum/views/forum_forum_templates_tools.xml @@ -126,7 +126,7 @@