fix: reset User ID and make it read-only if 'Create User Automatically' is set

(cherry picked from commit 2be6bb694f)
This commit is contained in:
Rucha Mahabal
2026-03-23 15:42:13 +05:30
committed by Mergify
parent 553bc87ac7
commit af94ed865a

View File

@@ -96,6 +96,15 @@ frappe.ui.form.on("Employee", {
}
},
create_user_automatically: function (frm) {
if (frm.doc.create_user_automatically) {
frm.set_value("user_id", "");
frm.set_df_property("user_id", "read_only", 1);
} else {
frm.set_df_property("user_id", "read_only", 0);
}
},
prefered_contact_email: function (frm) {
frm.events.update_contact(frm);
},