Monday, July 4, 2022

Change user password with function in odoo

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

Odoo Invoice Qr code issues

There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...