I am trying to add role to user by code . below is my code
if self.user_rol == "abcr User":
user = frappe.get_doc("User",self.email)
"doctype": "Has Role",
While adding the new password the role automatically get removed for the user.Please help me to fix this .