HR employee left should disable userid

Small customization on HR when employee left usually no communication to Admin to disable userid (if added on his form).

System should check if status left and userid => disable.

You can use below custom script in Employee

validate:function(frm){
    if(frm.doc.status == 'Left'){
	frappe.call({
	method: "frappe.client.set_value",
	args: {
		doctype: "User",
		name: frm.doc.user_id,
		fieldname: "enabled",
		value: 0,
	},
	freeze: true,
	callback:(r){
		frappe.msgprint(__("User has been Disable from Access"));
	}
});

	}
1 Like

Thanks for the reply but my point here was to make it standard or as a option to HR…

We have done this but I believe many other non-developers require as a standard.

1 Like

I think you should raise a github issue or make pull request with this functionality

1 Like

Added a Github Issue for this:

1 Like