Odoo Help


Users Info of a session openERPSession for httprequest (OpenERP version - 7 ) through session id

on 7/28/14, 5:30 AM 5,875 views

Hi All, 
 If anyone help about how to get users info for a particular session in openerp, like user id for that session and their password. 



Clement Zotti
On 7/28/14, 4:23 PM


I don't know where you can find the session (I think Odoo web client send password and login for each request to the server)

So you can have some information into the _uid_cache inside a res_users inherited object like:


class my_model(osv.Model):

      _inherit = 'res.users'


you can check into the res_users.py file:


there are a _uid_cache dictionnary which contains the password for the current user and probably more data(I don't check).

And this is the login function call when you click Login on the login odoo page:


Probably try to override it if you want to store the data.


Hope this help a little.


shashank verma
On 7/28/14, 4:31 PM

Hello Abhishek,

You can directly fetch the user info from pgadmin.
In your .py file for any custom function you specify uid such as
def custom_func(self,cr,uid,ids,context):
    print user_obj #gives u all info about the current login user.
I am not sure about why your query is focused more on users under current sessions because whatever the sessions will be ,the user info will be authenticated from openerp models/objects.Hence you can directly fetch user info from pgadmin.

Though i dont have knowlegde of backbone js but following code might help you to play with sessions:

1. Go to /addons/web/static/src/js
2. open chrome.js
3. find this function:
    do_login: function (db, login, password) {
        var self = this;
        return this.session.session_authenticate(db, login, password).then(function() {
            if (self.has_local_storage && self.remember_credentials) {
                localStorage.setItem(db + '|last_login', login);
        }, function () {
            self.$(".oe_login_pane").fadeIn("fast", function() {
                self.show_error(_t("Invalid username or password"));

On 7/29/14, 2:54 PM

Dear Friends Thanks for your answers but this is not the things what I am looking for...

Basically what I am looking is based on web moudule specially to get HTTP/JSON request in OpenERP.
I am using currently openerp.addons.web.session import OpenERPSession mainly _cp_path and (openerpweb.Controller) so  not able to call directly any osv.model from here.

My need is similar like to send some and http request to a third party server, and then that server will do the process on the given data by that http request and than that third party server will return sucess/reponse message to openerp through a return url on openerp, which is working currently very fine able to get the reponse from thrid party server but for storing the same data I am trying to store in related table of openerp with web services (xmlrpclib), for which I need the user info of a session in OpenERP. currently just getting a session id , database name. host name & port etc... but not user info.

If possible kindly let me know if someone ca suggest better.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 7/28/14, 5:30 AM
Seen: 5875 times
Last updated: 3/16/15, 8:10 AM