[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) <tde@openerp.com>
This commit is contained in:
Thibault Delavallée
2023-03-23 20:12:45 +01:00
parent deee288909
commit 2c5738d7ab
@@ -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