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_odooimportget_settings_odooexceptImportError:fromget_settings_odooimportget_settings_odooresult=get_settings_odoo()db=result[0]uid=result[1]password=result[3]models=result[4]
[docs]deflogin_exist(login):""" Function checks if a user with that login already exists in the odoo database in the table res.users. """result='False'iflogin!='':# check over the nonactive users number=models.execute_kw(db,uid,password,'res.users','search_count',[[['login','=',login],]])ifnumber>0:result='True'else:passreturn(result)