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

Add view to add annual leave in bulk #32

Open
moshthepitt opened this issue Nov 25, 2019 · 2 comments
Open

Add view to add annual leave in bulk #32

moshthepitt opened this issue Nov 25, 2019 · 2 comments

Comments

@moshthepitt
Copy link
Owner

  • Check all active staff members that do not have leave days
  • Generate llist of the users with with formsets for the annual leave records of each user
  • Create the records when saved
@moshthepitt
Copy link
Owner Author

Optionally add a flag to notify admin that there are users with no annual leave records

@moshthepitt
Copy link
Owner Author

l = Leave.SICK
d = 10
y = 2019
for item in StaffProfile.objects.exclude(annualleave__leave_type=l, annualleave__year=y):
    annual_leave = AnnualLeave(year=y, staff=item, allowed_days=d, leave_type=l)
    annual_leave.save()

l = Leave.REGULAR
d = 10
y = 2019
for item in StaffProfile.objects.exclude(annualleave__leave_type=l, annualleave__year=y):
    annual_leave = AnnualLeave(year=y, staff=item, allowed_days=d, leave_type=l)
    annual_leave.save()

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

No branches or pull requests

1 participant