Merge branch 'hotfix' into name_fix_hotfix

This commit is contained in:
Deepesh Garg
2019-05-01 14:27:17 +05:30
committed by GitHub

View File

@@ -78,7 +78,7 @@ class Employee(NestedSet):
def update_user_permissions(self):
if not self.create_user_permission: return
if not has_permission('User Permission', ptype='write'): return
if not has_permission('User Permission', ptype='write', raise_exception=False): return
employee_user_permission_exists = frappe.db.exists('User Permission', {
'allow': 'Employee',
@@ -237,7 +237,7 @@ def validate_employee_role(doc, method):
def update_user_permissions(doc, method):
# called via User hook
if "Employee" in [d.role for d in doc.get("roles")]:
if not has_permission('User Permission', ptype='write'): return
if not has_permission('User Permission', ptype='write', raise_exception=False): return
employee = frappe.get_doc("Employee", {"user_id": doc.name})
employee.update_user_permissions()