From 8da2cb6d4a6b99ef56cbb64a7c8753ab9a0e3365 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 May 2014 14:31:55 +0200 Subject: [PATCH 1/5] [FIX] definition of badges --- addons/website_forum/data/badges_participation.xml | 6 +++--- addons/website_forum/data/badges_question.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/website_forum/data/badges_participation.xml b/addons/website_forum/data/badges_participation.xml index 05c2540d77d..fc07eaaf864 100644 --- a/addons/website_forum/data/badges_participation.xml +++ b/addons/website_forum/data/badges_participation.xml @@ -78,16 +78,16 @@ 10 - + Pundit - Left comments with score of 10 or more + Left 10 answers with score of 10 or more silver nobody Pundit - Post 10 comments with score of 10 or more + Post 10 answers with score of 10 or more boolean higher diff --git a/addons/website_forum/data/badges_question.xml b/addons/website_forum/data/badges_question.xml index ff2d63c034d..39c1fca9f20 100644 --- a/addons/website_forum/data/badges_question.xml +++ b/addons/website_forum/data/badges_question.xml @@ -372,7 +372,7 @@ count boolean - [('parent_id', '=', False), ('is_correct', '=', True)] + [('parent_id', '=', False), ('has_validated_answer', '=', True)] higher True From c786ceb760563e5cdc205c1dd2b95e6513426244 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 May 2014 14:32:21 +0200 Subject: [PATCH 2/5] [FIX] the badges should be ordered by most popular first --- addons/website_forum/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index f196909b065..b94e818d0c5 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -599,6 +599,7 @@ class WebsiteForum(http.Controller): Badge = request.registry['gamification.badge'] badge_ids = Badge.search(cr, SUPERUSER_ID, [('challenge_ids.category', '=', 'forum')], context=context) badges = Badge.browse(cr, uid, badge_ids, context=context) + badges = sorted(badges, key=lambda b: b.stat_count_distinct, reverse=True) values = self._prepare_forum_values(forum=forum, searches={'badges': True}) values.update({ 'badges': badges, From 70d3652c27ce0a6936f30eaf8af124676e5fa90a Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 May 2014 14:41:56 +0200 Subject: [PATCH 3/5] [FIX] remove closing reason 'an answer was accepted', the questions should be left as open to be possible to improve the answer afterward --- addons/website_forum/data/forum_data.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml index a387a8de7ae..2db99477f61 100644 --- a/addons/website_forum/data/forum_data.xml +++ b/addons/website_forum/data/forum_data.xml @@ -70,9 +70,6 @@ not a real question - - already answered and an answer was accepted - not relevant or out dated From 4d9aa300a725d0bbdfadd87d547e150769f13f40 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 20 May 2014 14:50:51 +0200 Subject: [PATCH 4/5] [IMP] as the closing reason is not required, do not display it if none is present --- addons/website_forum/views/website_forum.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 0f132c48420..f596193c56a 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -436,7 +436,7 @@