From 64ef5ce03f7ad7cb5bd2a8d767f556a87d9933f9 Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP)" Date: Tue, 18 Mar 2014 18:11:30 +0530 Subject: [PATCH 1/4] [imp]:improeve demo tag and valid answer bzr revid: sunilsharma.sharma07@gmail.com-20140318124130-9ykkk6g1c6ry7ysx --- addons/website_forum/data/forum_demo.xml | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/addons/website_forum/data/forum_demo.xml b/addons/website_forum/data/forum_demo.xml index d5dadc8ecf8..16c878b93c2 100644 --- a/addons/website_forum/data/forum_demo.xml +++ b/addons/website_forum/data/forum_demo.xml @@ -38,6 +38,37 @@ + + one2many + + + + + offline + + + + + ecommerce + + + + + xmlRPC + + + + + Stock + + + + + update + + + + How to configure alerts for employee contract expiration. @@ -52,6 +83,7 @@ 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 + @@ -72,6 +104,7 @@ 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 +116,7 @@ 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 +128,7 @@ 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 +140,7 @@ 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 +148,7 @@ 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!!! + @@ -137,12 +174,14 @@ Thank you in advance How to refresh weight of stock move lines after product weight update? 56 + Update new module v7.0 Ubuntu 12.04 87 + @@ -193,6 +232,7 @@ Thank you in advance + True @@ -202,6 +242,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) + True @@ -223,6 +264,7 @@ Thank you in advance voucher_id should be the ID of the created voucher. + True @@ -291,6 +333,7 @@ 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 From 0e1483bba95753917b5cb44f4255c883defa9abf Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP)" Date: Wed, 19 Mar 2014 10:36:35 +0530 Subject: [PATCH 2/4] [imp]:improve user downvote or upvote and improve create_uid field to user_id bzr revid: sunilsharma.sharma07@gmail.com-20140319050635-7ph64mvoy58pbm3r --- addons/website_forum/controllers/main.py | 18 ++-- .../website_forum/data/forum_badges_data.xml | 44 ++++----- addons/website_forum/data/forum_demo.xml | 89 ++++++++++++++++++- addons/website_forum/models/website_forum.py | 4 +- addons/website_forum/views/website_forum.xml | 6 +- 5 files changed, 123 insertions(+), 38 deletions(-) diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index f9d98b383f4..1c74b7e0bce 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -72,7 +72,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': @@ -117,7 +117,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 = { @@ -162,17 +162,17 @@ class website_forum(http.Controller): Activity = request.registry['mail.message'] Data = request.registry["ir.model.data"] - 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] - 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) user_post_ids = question_ids + obj_ids model, comment = Data.get_object_reference(cr, uid, 'mail', 'mt_comment') @@ -240,7 +240,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, @@ -391,7 +391,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 16c878b93c2..70138f1c2bc 100644 --- a/addons/website_forum/data/forum_demo.xml +++ b/addons/website_forum/data/forum_demo.xml @@ -68,12 +68,14 @@ + How to configure alerts for employee contract expiration. 5 + @@ -84,6 +86,7 @@ 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 + @@ -92,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. + @@ -105,6 +109,7 @@ 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. + @@ -117,6 +122,7 @@ Can I use OpenERP as a replacement CMS of Wordpress + eCommerce plugin? In simple words does OpenERP became CMS+ERP platform? + @@ -129,6 +135,7 @@ I have been trying to register an invoice payment through OpenERP. I have been a I'm currently creating the voucher using this information: + @@ -141,6 +148,7 @@ I shall like creating a field "x" on an order form ( stock.picking.form ) and to Thank you in advance + @@ -149,6 +157,7 @@ Thank you in advance 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!!! + @@ -157,6 +166,7 @@ Thank you in advance 5 hi, how to import csv into customer database? Thanks + @@ -168,6 +178,7 @@ 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 + @@ -175,6 +186,7 @@ Thank you in advance 56 + @@ -182,6 +194,7 @@ Thank you in advance 87 + @@ -189,6 +202,7 @@ Thank you in advance 45 + @@ -198,7 +212,7 @@ Thank you in advance - + @@ -211,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. + @@ -233,6 +248,7 @@ Thank you in advance True + @@ -242,7 +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) - True + @@ -251,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. + @@ -265,6 +282,7 @@ Thank you in advance True + @@ -281,6 +299,7 @@ Thank you in advance Hope this helps! + @@ -304,6 +323,7 @@ Thank you in advance + @@ -317,6 +337,7 @@ Thank you in advance Password: Your E-Mail password + @@ -325,6 +346,7 @@ Thank you in advance also settings-> update moduel list? can find this anywhere?? + @@ -334,6 +356,69 @@ Thank you in advance True + + + + + + + + + 1 + + + + + + -1 + + + + + + -1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + -1 + + + + + + 1 + + + + + + 1 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 2073623459e..853d47afd56 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 @@ -393,7 +393,7 @@
  • delete
  • share
  • - + Answered on From 3fa07a4d6a5a100099268c537efda67cf0610462 Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP)" Date: Wed, 19 Mar 2014 12:06:42 +0530 Subject: [PATCH 3/4] [imp]:admin user edit a question asked by demo user to improve typo bzr revid: sunilsharma.sharma07@gmail.com-20140319063642-4fek8778h2h8b82y --- addons/website_forum/__openerp__.py | 3 ++- addons/website_forum/data/question_improvement.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 addons/website_forum/data/question_improvement.yml 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/data/question_improvement.yml b/addons/website_forum/data/question_improvement.yml new file mode 100644 index 00000000000..2526824a9a0 --- /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 From 70b0535d1e2b7fcc7dd074a3afe75ca0b1fcbde3 Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP)" Date: Wed, 19 Mar 2014 17:16:13 +0530 Subject: [PATCH 4/4] [imp]:improve run scheduler bzr revid: sunilsharma.sharma07@gmail.com-20140319114613-mkoqzpj5wdgf0oih --- addons/website_forum/data/forum_demo.xml | 3 +++ addons/website_forum/data/question_improvement.yml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/website_forum/data/forum_demo.xml b/addons/website_forum/data/forum_demo.xml index 70138f1c2bc..a0370cbcefa 100644 --- a/addons/website_forum/data/forum_demo.xml +++ b/addons/website_forum/data/forum_demo.xml @@ -421,5 +421,8 @@ Thank you in advance 1 + + + diff --git a/addons/website_forum/data/question_improvement.yml b/addons/website_forum/data/question_improvement.yml index 2526824a9a0..a736fcfba8f 100644 --- a/addons/website_forum/data/question_improvement.yml +++ b/addons/website_forum/data/question_improvement.yml @@ -4,5 +4,5 @@ - !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 + 'name': 'CMS Replacement For ERP and ECommerce ?', + }) \ No newline at end of file