-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toggle self leave approval for employees from HR settings (backport #2486) #2734
Conversation
(cherry picked from commit c74d2bb) # Conflicts: # hrms/hr/doctype/hr_settings/hr_settings.json
… based on the leave approval HR setting (cherry picked from commit 4acf169) # Conflicts: # hrms/hr/doctype/leave_application/leave_application.js # hrms/hr/doctype/leave_application/leave_application.py
(cherry picked from commit 24056f3)
(cherry picked from commit 525fcdd)
…plication (cherry picked from commit 7653c51)
…etting (cherry picked from commit 654d55b)
(cherry picked from commit 0610d4b)
(cherry picked from commit 8374c75)
refactor: used onload to check hr settings refactor: hr setting name changed for readability (cherry picked from commit 52b5e1f) # Conflicts: # hrms/hr/doctype/hr_settings/hr_settings.json # hrms/hr/doctype/leave_application/leave_application.js
(cherry picked from commit e49c5a7) # Conflicts: # hrms/hr/doctype/hr_settings/hr_settings.json
(cherry picked from commit 079054c)
(cherry picked from commit bb15010) # Conflicts: # hrms/hr/doctype/leave_application/leave_application.js
Cherry-pick of c74d2bb has failed:
Cherry-pick of 4acf169 has failed:
Cherry-pick of 52b5e1f has failed:
Cherry-pick of e49c5a7 has failed:
Cherry-pick of bb15010 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Most new settings in HR aren't available in v14, skipping this one too. |
Issue
Immediately after employees create and save leave application they see the document with "submit" as primary action that can lead to confusion as to clicking submit is part of the leave application process. So the employees ended up submitting their own leaves even if a different leave approver was already set in the application.
Role permission do not help in case one employee is leave approver for another employee.
Before
self_leave_approval_before.mov
After
self_leave_approval_pwa_after.mov
Screen.Recording.2025-01-30.at.2.46.24.PM.mov
Fix
Added a new setting in HR Settings called Prevent self-approval for leaves even if user has permissions which is disabled by default to retain current behaviour.
The submit action is removed on leave application if the settings is checked. Setting is ignored if the leave application doctype has a workflow.
Added tests for when self approval is enabled/disabled
I'll update the documentation once this is merged, no-docs for now
This is an automatic backport of pull request #2486 done by Mergify.