Source code for odoo_xmlrpc_twisted.functions.email_exist
"""Check if a user with that e-mail 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_odoosettings=get_settings_odoo()db=settings[0]uid=settings[1]password=settings[3]models=settings[4]
[docs]defemail_exist(email):""" Functions tests if a user with that e-mail already exists in the odoo database. """result='False'ifemail!='':number=models.execute_kw(db,uid,password,'res.users','search_count',[[['email','=',email],]])ifnumber>0:result='True'else:passreturn(result)