diff --git a/addons/website_forum/__openerp__.py b/addons/website_forum/__openerp__.py index 9b1f26d21b7..8e71054e565 100644 --- a/addons/website_forum/__openerp__.py +++ b/addons/website_forum/__openerp__.py @@ -41,7 +41,8 @@ Ask questions, get answers, no distractions 'static/src/xml/*.xml' ], 'demo': [ - 'data/forum_demo.xml' + 'data/forum_demo.xml', + 'data/question_improvement.yml', ], 'css': ['static/src/css/website_forum.css'], 'installable': True, diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 96d4a8472e2..47f48eee221 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -81,7 +81,7 @@ class website_forum(http.Controller): domain += [ ('child_ids', '=', False) ] #TODO: update domain to show followed questions of user if filters == 'followed': - domain += [ ('create_uid', '=', uid) ] + domain += [ ('user_id', '=', uid) ] # Note: default sorting should be based on last activity if not sorting or sorting == 'date': @@ -140,7 +140,7 @@ class website_forum(http.Controller): def question(self, forum, question, **post): answer_done = False for answer in question.child_ids: - if answer.create_uid.id == request.uid: + if answer.user_id.id == request.uid: answer_done = True filters = 'question' values = { @@ -187,21 +187,21 @@ class website_forum(http.Controller): Data = request.registry["ir.model.data"] #questions asked by user. - question_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('create_uid', '=', user.id), ('parent_id', '=', False)], context=context) + question_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('user_id', '=', user.id), ('parent_id', '=', False)], context=context) user_questions = Post.browse(cr, uid, question_ids, context=context) #showing questions in which user answered - obj_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('create_uid', '=', user.id), ('parent_id', '!=', False)], context=context) + obj_ids = Post.search(cr, uid, [('forum_id', '=', forum.id), ('user_id', '=', user.id), ('parent_id', '!=', False)], context=context) user_answers = Post.browse(cr, uid, obj_ids, context=context) answers = [answer.parent_id for answer in user_answers] #votes which given on users questions and answers. - total_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.create_uid', '=', user.id)], count=True, context=context) - up_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.create_uid', '=', user.id), ('vote', '=', '1')], count=True, context=context) - down_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.create_uid', '=', user.id), ('vote', '=', '-1')], count=True, context=context) + total_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id)], count=True, context=context) + up_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '1')], count=True, context=context) + down_votes = Vote.search(cr, uid, [('post_id.forum_id', '=', forum.id), ('post_id.user_id', '=', user.id), ('vote', '=', '-1')], count=True, context=context) #Votes which given by users on others questions and answers. - post_votes = Vote.search(cr, uid, [('user_id', '=', uid)], context=context) + post_votes = Vote.search(cr, uid, [('user_id', '=', user.id)], context=context) vote_ids = Vote.browse(cr, uid, post_votes, context=context) #activity by user. @@ -231,7 +231,7 @@ class website_forum(http.Controller): 'down_votes': down_votes, 'activities': activities, 'posts': posts, - 'vote_post':vote_ids, + 'vote_post': vote_ids, 'notifications': self._get_notifications(), } return request.website.render("website_forum.user_detail_full", values) @@ -242,6 +242,7 @@ class website_forum(http.Controller): create_context = dict(context) new_question_id = request.registry['website.forum.post'].create( request.cr, request.uid, { + 'user_id': uid, 'forum_id': forum.id, 'name': question.get('question_name'), 'content': question.get('question_content'), @@ -272,7 +273,7 @@ class website_forum(http.Controller): cr, uid, context = request.cr, request.uid, request.context request.registry['res.users'].write(cr, uid, uid, {'forum': True}, context=context) for answer in post.child_ids: - if answer.create_uid.id == request.uid: + if answer.user_id.id == request.uid: post_answer = answer values = { 'post': post, @@ -431,7 +432,7 @@ class website_forum(http.Controller): cr, uid, context = request.cr, request.uid, request.context Post = request.registry['website.forum.post'] post = Post.browse(cr, uid, int(kwarg.get('post_id')), context=context) - if post.create_uid.id == uid: + if post.user_id.id == uid: correct = False if post.correct else True #Note: only one answer can be right. for child in post.parent_id.child_ids: diff --git a/addons/website_forum/data/forum_badges_data.xml b/addons/website_forum/data/forum_badges_data.xml index e9c52ae9b02..c503dc713e6 100644 --- a/addons/website_forum/data/forum_badges_data.xml +++ b/addons/website_forum/data/forum_badges_data.xml @@ -155,7 +155,7 @@ count boolean - [('create_uid','=',user.id), ('vote_count', '>=', 3)] + [('user_id','=',user.id), ('vote_count', '>=', 3)] higher @@ -221,7 +221,7 @@ count boolean - [('create_uid','=',user.id), ('vote_count', '>=', 3), ('correct', '=', True)] + [('user_id','=',user.id), ('vote_count', '>=', 3), ('correct', '=', True)] higher @@ -289,7 +289,7 @@ count boolean - + higher @@ -322,7 +322,7 @@ count boolean - [('create_uid','=',user.id), ('views', '>=', 500)] + [('user_id','=',user.id), ('views', '>=', 500)] higher @@ -357,7 +357,7 @@ def count_favorites(cr, uid, context=None): res = 1 Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('create_uid','=',uid), ('parent_id', '=', False)], context=context) + user_posts = Post.search(cr, uid, [('user_id','=',uid), ('parent_id', '=', False)], context=context) for post in Post.browse(cr, uid, user_posts, context=context): if len(post.favourite_ids) >= 5: res += 1 @@ -397,7 +397,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 6)] + [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 6)] higher @@ -430,7 +430,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] + [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] higher @@ -463,7 +463,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15)] + [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15)] higher @@ -496,7 +496,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 15)] + [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 15)] higher @@ -529,7 +529,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15), ('correct', '=', True)] + [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 15), ('correct', '=', True)] higher @@ -563,7 +563,7 @@ result = count_favorites(cr, uid, context=context) def get_posts(cr, uid, context=None): res = 1 Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('create_uid','=',uid), ('parent_id', '!=', False), ('vote_count', '>=', 2)], context=context) + user_posts = Post.search(cr, uid, [('user_id','=',uid), ('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") @@ -606,7 +606,7 @@ result = get_posts(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 4)] + [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 4)] higher @@ -639,7 +639,7 @@ result = get_posts(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] + [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 6)] higher @@ -672,7 +672,7 @@ result = get_posts(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('views', '>=', 250)] + [('user_id','=',user.id), ('parent_id', '=', False), ('views', '>=', 250)] higher @@ -741,7 +741,7 @@ result = get_posts(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('vote_count', '>=', -3)] + [('user_id','=',user.id), ('vote_count', '>=', -3)] higher @@ -774,7 +774,7 @@ result = get_posts(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('views', '>=', 150)] + [('user_id','=',user.id), ('parent_id', '=', False), ('views', '>=', 150)] higher @@ -853,7 +853,7 @@ result = get_count(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('correct', '=', True)] + [('user_id','=',user.id), ('parent_id', '=', False), ('correct', '=', True)] higher @@ -886,9 +886,9 @@ result = get_count(cr, uid, context=context) count boolean - [('create_uid','=',user.id), + [('user_id','=',user.id), ('parent_id', '!=', False), - ('parent_id.create_uid', '!=', user.id), + ('parent_id.user_id', '!=', user.id), ('vote_count', '>=', 4)] higher @@ -925,7 +925,7 @@ result = get_count(cr, uid, context=context) def count_favorites(cr, uid, context=None): res = 1 Post = self.pool['website.forum.post'] - user_posts = Post.search(cr, uid, [('create_uid','=',uid), ('parent_id', '=', False)], context=context) + user_posts = Post.search(cr, uid, [('user_id','=',uid), ('parent_id', '=', False)], context=context) for post in Post.browse(cr, uid, user_posts, context=context): if len(post.favourite_ids) >= 25: res += 1 @@ -998,7 +998,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 1)] + [('user_id','=',user.id), ('parent_id', '=', False), ('vote_count', '>=', 1)] higher @@ -1097,7 +1097,7 @@ result = count_favorites(cr, uid, context=context) count boolean - [('create_uid','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 3)] + [('user_id','=',user.id), ('parent_id', '!=', False), ('vote_count', '>=', 3)] higher diff --git a/addons/website_forum/data/forum_demo.xml b/addons/website_forum/data/forum_demo.xml index d5dadc8ecf8..a0370cbcefa 100644 --- a/addons/website_forum/data/forum_demo.xml +++ b/addons/website_forum/data/forum_demo.xml @@ -38,11 +38,44 @@ + + one2many + + + + + offline + + + + + ecommerce + + + + + xmlRPC + + + + + Stock + + + + + update + + + + + How to configure alerts for employee contract expiration. 5 + @@ -52,6 +85,8 @@ I use a XML-RPC to access to invoices, I want to get the states of invoices, but always I get paid instead of PayƩ (French) 4 + + @@ -60,6 +95,7 @@ I use a XML-RPC to access to invoices, I want to get the states of invoices, but 122 Can anybody tell me how to restrict the user from confirming the purchase requisition? In my case when a user is creating a purchase requisition than the user after saving it is able to send it to the supplier rather I want the user to just generate the purchase requisition and let the manager do the remaining works like sending the purchase requisition to the supplier and than receiving the goods. Please help me out. Thanks in advance. + @@ -72,6 +108,8 @@ P.S. AFAIK current version (7.x) supports web interface while the desktop clients became deprecated. BTW, I left OpenERP since ver. 6.x to use PostBooks instead but I recently decided to use OpenERP once again after recent new features. + + @@ -83,6 +121,8 @@ BTW, I left OpenERP since ver. 6.x to use PostBooks instead but I recently decid Can I use OpenERP as a replacement CMS of Wordpress + eCommerce plugin? In simple words does OpenERP became CMS+ERP platform? + + @@ -94,6 +134,8 @@ In simple words does OpenERP became CMS+ERP platform? I have been trying to register an invoice payment through OpenERP. I have been able to manually create and approve the invoice, the voucher and its line I'm currently creating the voucher using this information: + + @@ -105,6 +147,8 @@ I'm currently creating the voucher using this information: I shall like creating a field "x" on an order form ( stock.picking.form ) and to reveal it also on the delivery slip ( stock.picking.form ). Thank you in advance + + @@ -112,6 +156,8 @@ Thank you in advance 1 Now i create new group , assign user and access right as READ & CREATE to object stock.picking.ads but nothing is reflected , iam able to delete and write which should not happen. Very Strange!!! + + @@ -120,6 +166,7 @@ Thank you in advance 5 hi, how to import csv into customer database? Thanks + @@ -131,18 +178,23 @@ Thank you in advance the email is not received to the recipients .Those emails are stored in the Archives under the Messaging window.How to configure incoming and outgoing mails in openerp + How to refresh weight of stock move lines after product weight update? 56 + + Update new module v7.0 Ubuntu 12.04 87 + + @@ -150,6 +202,7 @@ Thank you in advance 45 + @@ -159,7 +212,7 @@ Thank you in advance - + @@ -172,6 +225,7 @@ Thank you in advance Step 5. Go to Scheduled Actions.. Set interval number to 1. Interval Unit to Minutes. Then Set the Next Execution date to 2 minutes from now. If your SMTP is configured correctly you will start to get a mail every minute with the reminder. + @@ -193,6 +247,8 @@ Thank you in advance + True + @@ -202,6 +258,7 @@ Thank you in advance Then you have to activate the module, see the tutorial on acespritechblog.wordpress.com (sorry I cannot post the full link) + @@ -210,6 +267,7 @@ Thank you in advance The CMS editor in OpernERP web is nice but I prefer drupal for customization and there is a drupal module for OpenERP. I think WP is better than OpenERP web too. + @@ -223,6 +281,8 @@ Thank you in advance voucher_id should be the ID of the created voucher. + True + @@ -239,6 +299,7 @@ Thank you in advance Hope this helps! + @@ -262,6 +323,7 @@ Thank you in advance + @@ -275,6 +337,7 @@ Thank you in advance Password: Your E-Mail password + @@ -283,6 +346,7 @@ Thank you in advance also settings-> update moduel list? can find this anywhere?? + @@ -291,7 +355,74 @@ Thank you in advance Give your admin user the technical features right and you will be able to see more options in the settings menu. (use a refresh) + True + + + + + + + 1 + + + + + + -1 + + + + + + -1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + -1 + + + + + + 1 + + + + + + 1 + + + + + diff --git a/addons/website_forum/data/question_improvement.yml b/addons/website_forum/data/question_improvement.yml new file mode 100644 index 00000000000..a736fcfba8f --- /dev/null +++ b/addons/website_forum/data/question_improvement.yml @@ -0,0 +1,8 @@ + +- + Admin User Edit a Question asked by demo user to improve typo +- + !python {model: website.forum.post}: | + self.write(cr, ref('base.user_root'), [ref('website_forum.question_5')],{ + 'name': 'CMS Replacement For ERP and ECommerce ?', + }) \ No newline at end of file diff --git a/addons/website_forum/models/website_forum.py b/addons/website_forum/models/website_forum.py index 14d46c3f39a..3c1f89a6ca6 100644 --- a/addons/website_forum/models/website_forum.py +++ b/addons/website_forum/models/website_forum.py @@ -105,7 +105,7 @@ class Post(osv.Model): 'forum_id': fields.many2one('website.forum', 'Forum', required=True), 'content': fields.text('Content'), 'create_date': fields.datetime('Asked on', select=True, readonly=True), - 'create_uid': fields.many2one('res.users', 'Asked by', select=True, readonly=True ), + 'user_id': fields.many2one('res.users', 'Asked by', select=True, readonly=True ), 'write_date': fields.datetime('Update on', select=True, readonly=True ), 'write_uid': fields.many2one('res.users', 'Update by', select=True, readonly=True), @@ -167,7 +167,7 @@ class Post(osv.Model): 'name': post.name, 'tags': [(6,0, [x.id for x in post.tags])], 'date': post.write_date or post.create_date, - 'user_id': post.write_uid and post.write_uid.id or post.create_uid.id + 'user_id': post.write_uid and post.write_uid.id or post.user_id.id }, context=context) def create(self, cr, uid, vals, context=None): diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index d7914d6ba8a..6916a4c9d5b 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -49,7 +49,7 @@
- by , + by , on - + Asked on @@ -394,7 +394,7 @@
  • delete
  • share
  • - + Answered on