mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-02 06:29:54 +00:00
fix: set create user perm to 1 by default + persist option while saving employee
(cherry picked from commit 091899d0df)
This commit is contained in:
@@ -63,7 +63,7 @@ frappe.ui.form.on("Employee", {
|
||||
fieldtype: "Check",
|
||||
fieldname: "create_user_permission",
|
||||
label: __("Create User Permission"),
|
||||
default: 0,
|
||||
default: 1,
|
||||
},
|
||||
],
|
||||
primary_action_label: __("Create"),
|
||||
|
||||
@@ -459,12 +459,12 @@ def create_user(employee: str, email: str | None = None, create_user_permission:
|
||||
"bio": emp.bio,
|
||||
}
|
||||
)
|
||||
frappe.db.set_value("Employee", emp.name, "user_id", email)
|
||||
emp.db_set("user_id", email)
|
||||
user.append_roles("Employee")
|
||||
user.insert()
|
||||
|
||||
emp.reload()
|
||||
emp.user_id = user.name
|
||||
emp.create_user_permission = cint(create_user_permission)
|
||||
if not emp.company_email:
|
||||
emp.company_email = email
|
||||
if not emp.prefered_contact_email:
|
||||
|
||||
Reference in New Issue
Block a user