fix(setup): let HR users set the image of an employee linked to a user

Saving an employee with a new image attaches the image to the linked
User. That File insert checked write permission on User, which HR
users do not have.

(cherry picked from commit 70eaef1ce3)
This commit is contained in:
Mihir Kandoi
2026-10-26 16:22:36 +00:00
committed by Mergify
parent 6ae2594a63
commit 235dcca08e
+1 -1
View File
@@ -149,7 +149,7 @@ class Employee(NestedSet):
"attached_to_doctype": "User",
"attached_to_name": self.user_id,
}
).insert(ignore_if_duplicate=True)
).insert(ignore_permissions=True, ignore_if_duplicate=True)
except frappe.DuplicateEntryError:
# already exists
pass