Skip to content
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

fix: don't allow manual updates for earned leave allocation after submission #399

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Mar 20, 2023

Problem

Earned Leaves are auto-allocated via scheduler based on the annual allocation set in policy assignment.
Manually updating New Leaves Allocated field makes no sense here, since leaves are automatically computed and allocated based on set frequency.
This can mess up the balance and calculation. Also, this validation is essential to overcome other problems like #397

Solution

Make the New Leaves Allocated field read-only if:

  • Leave Type has "Is Earned Leave" enabled and
  • Leave Allocation is linked to Leave Policy Assignment

image

Validate the same case on the server-side in on_update_after_submit

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant