From 7493326daf9a1fbcc1130aad28884c51748739c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 10 Apr 2014 15:38:46 +0200 Subject: [PATCH] [REM] website_forum: removed old badges files bzr revid: tde@openerp.com-20140410133846-0dze10b09b9xhcoi --- .../website_forum/data/forum_badges_data.xml | 1128 ----------------- 1 file changed, 1128 deletions(-) delete mode 100644 addons/website_forum/data/forum_badges_data.xml diff --git a/addons/website_forum/data/forum_badges_data.xml b/addons/website_forum/data/forum_badges_data.xml deleted file mode 100644 index 5882fb21af6..00000000000 --- a/addons/website_forum/data/forum_badges_data.xml +++ /dev/null @@ -1,1128 +0,0 @@ - - - - - - - Autobiographer - Completed own biography - bronze - - - - Completed own biography - Write some information about your self - count - boolean - - [('id','=',user.id), - ('partner_id.country_id', '!=', False), - ('partner_id.city', '!=', False), - ('partner_id.email', '!=', False)] - - lower - - - - Complete own biography - once - personal - never - - - inprogress - forum - - - - - 0 - - - - - Cleanup - First rollback - gold - - - - - - Cleanup - once - personal - never - - - inprogress - forum - - - - - - Commentator - Posted 10 comments - gold - - - - Commentator - commente on answer or question(Poste 10 comments) - count - boolean - - [('author_id','=',user.id), ('type', '=', 'comment')] - higher - - - - Commentator - once - personal - never - - - inprogress - forum - - - - - 10 - - - - - Critic - First downvote - gold - - - - Critic - First downvote - count - boolean - - [('user_id','=',user.id), ('vote', '=', '-1')] - higher - - - - Critic - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Disciplined - Deleted own post with 3 or more upvotes - gold - - - - Discipline - Delete own post with 3 or more upvotes - count - boolean - - [('user_id','=',user.id), ('vote_count', '>=', 3), ('active', '=', False)] - higher - - - - Disciplined - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Editor - First edit - gold - - - - - - Editor - once - personal - never - - - inprogress - forum - - - - - - Enlightened - First answer was accepted with 3 or more votes - silver - - - - Enlightened - First answer was accepted with 3 or more votes - count - boolean - - [('user_id','=',user.id), ('vote_count', '>=', 3), ('is_correct', '=', True)] - higher - - - - Enlightened - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Enthusiast - Voted on questions/answers for 15 days in a row - silver - - - - Enthusiast - Vote on questions/answers for 15 days in a row - python - def get_counter(cr, uid, context=None): - res = 1 - start_date = date.today() - timedelta(days=16) - end_date = date.today() - timedelta(days=1) - cr.execute('SELECT COUNT(id), create_date from website_forum_post_vote where create_date >= %s and create_date <= %s and user_id = %s GROUP BY create_date',(start_date,end_date, object.user_id.id,)) - data = cr.dictfetchall() - if len(data) == 15: - res += 1 - return res -result = get_counter(cr, uid, context=context) - - boolean - higher - - - - Enthusiast - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Expert - Posted more than 10 questions or answers in one tag - silver - - - - Expert - Post more than 10 questions in one tag - python - def get_counter(cr, uid, context=None): - res = 1 - Post = self.pool['website.forum.post'] - Tag = self.pool['website.forum.tag'] - for tag_id in Tag.search(cr, uid, [], context=context): - post_count = Post.search_count(cr, uid , [('tag_ids', 'in', tag_id), ('user_id', '=', object.user_id.id)], context=context) - if post_count >= 10: - res += 1 - return res -result = get_counter(cr, uid, context=context) - - boolean - higher - - - - Expert - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Famous Question - Asked a question with 500 views - gold - - - - Expert - Ask a question or give answer which can be viewd 500 times - count - boolean - - [('user_id','=',user.id), ('views', '>=', 500)] - higher - - - - Expert - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Favorite Question - Question favorited by 5 users - silver - - - - Favorite Question - Ask a question which can be favorited by minimum 5 users - python - def count_favorites(cr, uid, context=None): - res = 1 - Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('user_id','=',object.user_id.id), ('parent_id', '=', False)], context=context) - for post in Post.browse(cr, uid, user_posts, context=context): - if len(post.favourite_ids) >= 5: - res += 1 - return res -result = count_favorites(cr, uid, context=context) - - boolean - higher - - - - Favorite Question - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Good Answer - Answer voted up 6 times - silver - - - - Good Answer - Your answer should voted up 6 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 6)] - higher - - - - Good Answer - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Good Question - Question voted up 6 times - silver - - - - Good Question - Your Question should voted up 6 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] - higher - - - - Good Question - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Great Answer - Answer voted up 15 times - gold - - - - Great Answer - Your answer should voted up 15 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15)] - higher - - - - Great Answer - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Great Question - Question voted up 15 times - gold - - - - Great Question - Your Question should voted up 15 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 15)] - higher - - - - Great Question - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Guru - Answer accepted with 15 or more votes - silver - - - - Guru - Answer should accepted with 15 or more votes - count - boolean - - [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15), ('is_correct', '=', True)] - higher - - - - Great Answer - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Necromancer - Answered a question more than 30 days later with at least 2 votes - silver - - - - Necromancer - Answered a question more than 30 days later with at least 2 votes - python - def get_posts(cr, uid, context=None): - res = 1 - Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('user_id','=',object.user_id.id), ('parent_id', '!=', False), ('vote_count', '>=', 2)], context=context) - for post in Post.browse(cr, uid, user_posts, context=context): - print post.parent_id.create_date - question_date = datetime.strptime(post.parent_id.create_date, "%Y-%m-%d %H:%M:%S") - answer_date = datetime.strptime(post.create_date, "%Y-%m-%d %H:%M:%S") - if ((question_date - answer_date).days) >= 30: - res += 1 - return res -result = get_posts(cr, uid, context=context) - - boolean - higher - - - - Necromancer - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Nice Answer - Answer voted up 4 times - bronze - - - - Nice Answer - Your answer should voted up 4 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 4)] - higher - - - - Nice Answer - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Nice Quesiotn - Question voted up 4 times - bronze - - - - Nice Question - Your Question should voted up 6 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] - higher - - - - Nice Question - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Notable Question - Asked a question with 250 views - silver - - - - Notable Question - Your Question should viewed up 250 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('views', '>=', 250)] - higher - - - - Notable Question - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Organizer - First retag - bronze - - - - - - Organizer - once - personal - never - - - inprogress - forum - - - - - - Peer Pressure - Deleted own post with 3 or more downvotes - gold - - - - Peer Pressure - Delete own post with 3 or more down votes - count - boolean - - [('user_id','=',user.id), ('vote_count', '<=', -3), ('active', '=', False)] - higher - - - - Peer Pressure - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Popular Question - Asked a question with 150 views - gold - - - - Popular Question - Your Question should viewed up 150 times - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('views', '>=', 150)] - higher - - - - Popular Question - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Pundit - Left 10 comments with score of 10 or more - silver - - - - - Pundit - Post 10 comments with score of 10 or more - python - def get_count(cr, uid, context=None): - res = 1 - Message = self.pool['mail.message'] - Post = self.pool['website.forum.post'] - user_message = Message.read_group(cr, uid,[('create_uid','=',object.user_id.id), ('type', '=', 'comment'), ('model', '=', 'website.forum.post')], ['res_id'], groupby=['res_id'], context=context) - for rec in user_message: - if rec.get('res_id_count') >= 10: - post = Post.browse(cr, uid, rec.get('res_id'), context=context) - if post.vote_count >= 10: - res += 1 - return res -result = get_count(cr, uid, context=context) - - boolean - higher - - - - Pundit - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Scholar - Asked a question and accepted an answer - gold - - - - Scholar - Ask a question and accept an answer - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('is_correct', '=', True)] - higher - - - - Scholar - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - self-Learner - Answered own question with at least 4 up votes - gold - - - - self-Learner - Answere own question with at least 4 up votes - count - boolean - - [('user_id','=',user.id), - ('parent_id', '!=', False), - ('parent_id.user_id', '!=', user.id), - ('vote_count', '>=', 4)] - - higher - - - - self-Learner - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Stellar Question - Question favorited by 25 users - bronze - - - - Stellar Question - Ask a question which can be favorited by minimum 25 users - python - def count_favorites(cr, uid, context=None): - res = 1 - Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('user_id','=',object.user_id.id), ('parent_id', '=', False)], context=context) - for post in Post.browse(cr, uid, user_posts, context=context): - if len(post.favourite_ids) >= 25: - res += 1 - return res -result = count_favorites(cr, uid, context=context) - - boolean - higher - - - - Stellar Question - once - personal - never - - - inprogress - forum - - - - - 2 - - - - - Associate Editor - Edited 30 entries - silver - - - - - - Associate Editor - once - personal - never - - - inprogress - forum - - - - - - Student - Asked first question with at least one up vote - gold - - - - Student - Ask first question with at least one up vote - count - boolean - - [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 1)] - higher - - - - Student - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Supporter - First upvote - gold - - - - Supporter - First upwnvote - count - boolean - - [('user_id','=',user.id), ('vote', '=', '1')] - higher - - - - Supporter - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Taxonomist - Created a tag used by 15 questions - silver - - - - Taxonomist - Create a tag which can used in minimum 15 questions - count - boolean - - [('create_uid','=',user.id), ('posts_count', '>=', 15)] - higher - - - - Taxonomist - once - personal - never - - - inprogress - forum - - - - - 1 - - - - - Teacher - Received at least 3 upvote for an answer for the first time - gold - - - - Teacher - Give answer which can get at least 3 upvote - count - boolean - - [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 3)] - higher - - - - Teacher - once - personal - never - - - inprogress - forum - - - - - 1 - - - - -