From 2c5738d7ab4e7edc230ee012ebaf2ae131b0f5e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 23 Mar 2023 09:06:07 +0000 Subject: [PATCH] [FIX] website_forum: assign value for computed 'karma_flag' field Before this commit, the compute method was not returning the value for the field karma_flag field, and thus it was returning compute method failed to assign value error. After this commit, the compute method will return correctly set the value for karma_flag field from the forum. closes odoo/odoo#116281 X-original-commit: odoo/odoo@bfa3f2d Signed-off-by: Thibault Delavallee (tde) --- addons/website_forum/models/forum_post.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_forum/models/forum_post.py b/addons/website_forum/models/forum_post.py index 9c4dd4c1991..5f73b898246 100644 --- a/addons/website_forum/models/forum_post.py +++ b/addons/website_forum/models/forum_post.py @@ -246,6 +246,7 @@ class Post(models.Model): post.karma_unlink = post.forum_id.karma_unlink_own if is_creator else post.forum_id.karma_unlink_all post.karma_comment = post.forum_id.karma_comment_own if is_creator else post.forum_id.karma_comment_all post.karma_comment_convert = post.forum_id.karma_comment_convert_own if is_creator else post.forum_id.karma_comment_convert_all + post.karma_flag = post.forum_id.karma_flag post.can_ask = is_admin or user.karma >= post.forum_id.karma_ask post.can_answer = is_admin or user.karma >= post.forum_id.karma_answer