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

refactor: Shift Assignment Schedule #2454

Merged
merged 29 commits into from
Dec 19, 2024
Merged

Conversation

krantheman
Copy link
Member

@krantheman krantheman commented Nov 26, 2024

Changes

Shift Assignment Schedule -> Shift Schedule + Shift Schedule Assignment

Details

Shift Assignment Schedule (Ref (Shift Creation -> Shift Assignment Schedule)) has been broken into two new doctypes to enable reusability of schedule definitions:-

Shift Schedule

image

  • Has Shift Type, Frequency, and Repeat On Days fields
  • Is submitable (mostly to ensure consistency when these fields are fetched in the roster, but also to prevent general unexpected behaviour)
  • Can be named/renamed
  • Duplicate days are eliminated before validation

Docs: https://docs.frappe.io/hr/shift-schedule

Shift Schedule Assignment

image

  • This retains all the rest of the fields from the Shift Assignment Schedule doctype and functions in the same way, except that it fetches the Shift Type, Frequency, and Repeat On Days fields from the selected Shift Schedule
  • Shift Assignments are created via and linked to this doctype

Docs: https://docs.frappe.io/hr/shift-schedule-assignment

The Shift Assignment Schedule doctype has been deprecated and removed. A patch has been included that migrates all existing Shift Assignment Schedules into Shift Schedules and Shift Schedule Assignments. The Shift Schedules thus created will be randomly named, but can be renamed thereafter.

Roster

Details

image

  • Cleaned up and remove gray background (conforming to desk view)
  • Added Shift Location to shift cell, shift dialog, and in filters
  • Added View button to navigate to shift related doctypes
  • Added breadcrumbs to navigate to HR app
  • Fetch Shift Schedule based on input fields or create new one automatically

Shift Assignment Tool

Details

image

  • Added Assign Shift Schedule Action
    • Employees having active (enabled = 1) overlapping Shift Schedule Assignments are filtered out while rendering datatable
    • Added tests
  • Added Shift Location field

Docs: https://docs.frappe.io/hr/shift-assignment-tool#22-assigning-shift-schedules

Shift Tools

Details

image

image

  • Added Shift Tools dropdown with Shift Assignment Tool and Roster to all shift related doctype lists and some forms
  • Opening Shift Assignment Tool from this dropdown will open the related action. For e.g. Shift Schedule will open 'Assign Shift Schedule' with the Shift Schedule set as the one from where it was opened

PS. I apologise for the bloated nature of this PR. Looking back, a lot of this could've been broken down into smaller PRs. 😅

PPS. Shift Schedule should probably be validated more, for overlap and other things. Might pick this up in the future some time.

@krantheman krantheman marked this pull request as ready for review December 18, 2024 12:05
@krantheman krantheman merged commit 6bc37fe into develop Dec 19, 2024
7 checks passed
@krantheman krantheman deleted the shift-schedule-refactor branch December 19, 2024 10:48
krantheman added a commit that referenced this pull request Dec 19, 2024
…2454

refactor: Shift Assignment Schedule (backport #2454)
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.

2 participants