In this blog we will explain how to change user password with function in odoo
Example :
We created view with button that call wizard enable user to enter new password and click button to change his password with the new one , so this button must call python function that change his password and this function can be just as bellow
def change_password(self,user_id,new_password):
user = self.env['res.users'].search([('id','=',user_id)])
user.sudo().write({'password':new_password})
No comments:
Post a Comment