Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

[meta] how can I know who upvoted / downvoted my questions / answers?

By
Tarek Mohamed Ibrahim
on 9/24/15, 5:23 PM 710 views

I recently got upvoted, and I searched to find which is the question/answer that was upvoted with no succes. Sometimes I get known the source of upvote / downvote by checking the recent questions / answers I posted during the last two weeks, for example. I then guess the source of the karma change. I need a standard way to know this, any help ?

2

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2993
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 9/25/15, 5:13 PM

Here a small JS code to paste in the console to see who upvote/downote your own post.


openerp.website.session.session_reload().then(function() { 
var my_user = openerp.website.session.uid  
|| parseInt($('.website_forum .navbar a[href^="/forum/help-1/user/"]').attr('href').split('/').pop());
openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'forum.post.vote',
method: 'search_read',
args: [[['recipient_id','=',my_user]], ['post_id', 'vote', 'user_id']],
kwargs: { context: openerp.website.get_context()}
}).then(function(results) {
_.each(results, function(result) {
console.log('Post: ' + result.post_id[0] + ' | ' + result.vote + " by " + result.user_id[1]) });
})
})


Or to know on One post, who downvote / upvote ...


var post = <THE_POST_ID_HERE>;
openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'forum.post.vote',
method: 'search_read',
args: [[['post_id','=',post]], ['user_id', 'vote']],
kwargs: { context: openerp.website.get_context()}
}).then(function(result) {
function vote(x) {
this.user_name = x.user_id[1];
this.user_id = x.user_id[0];
this.vote = parseInt(x.vote);
}
res = [];
_.forEach(result, function(x){ res.push(new vote(x)); });
console.table(res, ['vote','user_id','user_name']);
})

nice!!

Axel Mendoza
on 9/25/15, 10:25 PM

Thx for reply, but I still need more help, I pasted the first code block in the Chrome console while I'm opening the link www.odoo.com with my login, but I got the following error : Uncaught TypeError: Cannot read property 'uid' of undefined at :2:38 at Object.InjectedScript._evaluateOn (:905:140) at Object.InjectedScript._evaluateAndWrap (:838:34) at Object.InjectedScript.evaluate (:694:21) what is the missing/wrong step I did. Thx in advance for your more help

Tarek Mohamed Ibrahim
on 9/26/15, 11:56 AM

You can try to remove "openerp.website.session.uid | "

Jérémy Kersten (jke)
on 9/26/15, 12:27 PM

thx very much, I got my user_id and put it in my_user and then called 'openerp.jsonRpc(...' and it has worked.

Tarek Mohamed Ibrahim
on 9/26/15, 1:16 PM

I updated the first code to reload session ! Thank for the reporting !

Jérémy Kersten (jke)
on 9/27/15, 7:13 AM
1

Yenthe

--Yenthe--
6706
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 9/25/15, 2:40 AM

Hi Tarek,

The Odoo forum has no way to find that out at the moment. At this point Odoo simply adds the xx karma you gain for an upvoted / accepted answer to your total.There is no way to see who gave you an upvote or downvote. The only way to find out where you've gained/lost karma is by looking at all your topics I'm afraid..The forum software still has a good possibility to grow there :)
I think they do not have all these abilities due to the resources it uses. I know the Odoo forum already has a hard time handling all the badges etc.

Yenthe

I hoped that they do something like this http://www.codeproject.com/script/Reputation/List.aspx?mid=7728905, if you have an account on CodeProject site you will understand what I mean

Tarek Mohamed Ibrahim
on 9/25/15, 10:12 AM

Hi Tarek, you could always do it in rpc Info is public, it's not a secret !!!

Jérémy Kersten (jke)
on 9/25/15, 2:27 PM
0

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 12/23/15, 2:48 PM

Check this updated post for references

https://www.odoo.com/es_ES/forum/help-1/question/how-to-know-who-vote-for-your-questions-or-answers-in-odoo-forum-v9-script-update-94628

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

4 follower(s)

Stats

Asked: 9/24/15, 5:23 PM
Seen: 710 times
Last updated: 12/23/15, 2:48 PM