fix(role): Set desk properties (e.g. search_bar) to 1 for roles with desk access (#21162)
Replace get_doc with new_doc, because default values are not retrieved when using get_doc. Some roles with desk_access had no access to most features of the desk, such as the search bar or the form's sidebar.
This commit is contained in:
parent
50a8c4423e
commit
66eb377492
1 changed files with 3 additions and 1 deletions
|
|
@ -1679,7 +1679,9 @@ def make_module_and_roles(doc, perm_fieldname="permissions"):
|
|||
|
||||
for role in list(set(roles)):
|
||||
if frappe.db.table_exists("Role", cached=False) and not frappe.db.exists("Role", role):
|
||||
r = frappe.get_doc(dict(doctype="Role", role_name=role, desk_access=1))
|
||||
r = frappe.new_doc("Role")
|
||||
r.role_name = role
|
||||
r.desk_access = 1
|
||||
r.flags.ignore_mandatory = r.flags.ignore_permissions = True
|
||||
r.insert()
|
||||
except frappe.DoesNotExistError as e:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue