Source code for odoo_xmlrpc_twisted.functions.login_exist

"""
Check if a user with that login already exists.
"""


# call the function "get_settings_odoo" to get the parameters
# for the logging of the model on the "odoo Webservice API"
try:
    from .get_settings_odoo import get_settings_odoo
except ImportError:
    from get_settings_odoo import get_settings_odoo
result   = get_settings_odoo()
db       = result[0]
uid      = result[1]
password = result[3]
models   = result[4]

    
[docs] def login_exist(login): """ Function checks if a user with that login already exists in the odoo database in the table res.users. """ result = 'False' if login != '': # check over the nonactive users number = models.execute_kw(db,uid, password, 'res.users', 'search_count', [[['login', '=', login], ]]) if number > 0: result = 'True' else: pass return(result)