Source code for odoo_xmlrpc_twisted.functions.change_password
"""Change the password of the user."""# 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]odoo_password=result[3]models=result[4]
[docs]defchange_password(login,password):""" Function to change the password of a user. """result='False'iflogin!='':try:# find the user which should be updateduser_id=models.execute_kw(db,uid,odoo_password,'res.users','search',[[['login','=',login],['x_activate_complete','=',True],]])# update of the user forxinuser_id:id=xmodels.execute_kw(db,uid,odoo_password,'res.users','write',[[id],{'password':password}])result='True'except:result='False'else:result='False'return(result)