Odoo Help

3

1
3 Risposte
3
Krishna India
01/04/14, 04:44

Here is the URL string for seamless login from another page to openerp.

localhost:8069/login?db=nas&login=&key=

4 Commenti
vimal j India
01/04/14, 05:38

This is working. Thanks Krishna

Semah Raddaoui Tunisia
18/04/14, 08:10

This works only if you have a single database in your server : add another database (nas2 for example) and try to connect to it .It will not work !!!

Krishna India
18/04/14, 08:19

It will work. You have to select nas2 database first..

Semah Raddaoui Tunisia
18/04/14, 11:09

I will connect to my OpenERP server from another website, it means that l WILL NOT not use the default login page so how can I select the database which I want to connect to

1
Alcaline Filippine
19/10/14, 22:37

hi

Do you have any idea how to restrict the login process? I want to disable the login process in openerp after working hours. any idea how to do that and where can i find the codes for this login button..

 

1 Commento
Wilbert Tan Indonesia
25/05/16, 05:40

If anyone know this, please post it. Need help doing this

1
Avatar

Gopakumar N G India

--Gopakumar N G--
1253
| 5 4 10
Cochin, India
--Gopakumar N G--

Project Lead at Bizweaver Technologies Pvt. Ltd.

Gopakumar N G India
15/11/13, 06:17

Check the module web, it defines the login form and js files etc, check also the file res_users.py in module base/res/ and there is the login function defined.

def login(self, db, login, password):
    if not password:
        return False
    user_id = False
    cr = pooler.get_db(db).cursor()
    try:
        # autocommit: our single update request will be performed atomically.
        # (In this way, there is no opportunity to have two transactions
        # interleaving their cr.execute()..cr.commit() calls and have one
        # of them rolled back due to a concurrent access.)
        cr.autocommit(True)
        # check if user exists
        res = self.search(cr, SUPERUSER_ID, [('login','=',login)])
        if res:
            user_id = res[0]
            # check credentials
            self.check_credentials(cr, user_id, password)
            # We effectively unconditionally write the res_users line.
            # Even w/ autocommit there's a chance the user row will be locked,
            # in which case we can't delay the login just for the purpose of
            # update the last login date - hence we use FOR UPDATE NOWAIT to
            # try to get the lock - fail-fast
            # Failing to acquire the lock on the res_users row probably means
            # another request is holding it. No big deal, we don't want to
            # prevent/delay login in that case. It will also have been logged
            # as a SQL error, if anyone cares.
            try:
                cr.execute("SELECT id FROM res_users WHERE id=%s FOR UPDATE NOWAIT", (user_id,), log_exceptions=False)
                cr.execute("UPDATE res_users SET login_date = now() AT TIME ZONE 'UTC' WHERE id=%s", (user_id,))
            except Exception:
                _logger.debug("Failed to update last_login for db:%s login:%s", db, login, exc_info=True)
    except openerp.exceptions.AccessDenied:
        _logger.info("Login failed for db:%s login:%s", db, login)
        user_id = False
    finally:
        cr.close()

    return user_id

and check the methods authenticate, check and check_credentials also.

8 Commenti
Semah Raddaoui Tunisia
15/11/13, 06:26

I want to connect directly from the url like this localhost:8089/?db=dbname(other arguments)

Gopakumar N G India
15/11/13, 06:40

I am not sure that you can do that, check the file main.py in module web/controllers/main.py. The URL and sessions are handled in it.

Semah Raddaoui Tunisia
15/11/13, 06:43

I asked a question ( help.openerp.com/question/36431/how-to-login-to-openerp-from-another-website/ ) and Fabien Pinckaers answered me " it's also possible to put login/pass in the url, but I don't remember what are the exact arguments"

Semah Raddaoui Tunisia
15/11/13, 06:56

Thank you Gopakumar, If you find a solution please tell me.

Gopakumar N G India
17/12/13, 03:09

Check the module "auth_oauth" it is used for sign in to OpenERP from other accounts.

Semah Raddaoui Tunisia
17/12/13, 03:50

we want to pass connection parameters in the URL and not "sign in to OpenERP from other accounts."

Krishna India
01/04/14, 04:42

I found it. This is the URL string http://localhost:8069/login?db=nas&login=&key=

Fai una domanda
Writer
Tags
Keep Informed
0 follower(s)
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.

Register
Odoo Training Center

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

Test it now