Skip to content

Commit

Permalink
assignment-rule-roster-employee-action
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuffGoodie committed Dec 24, 2024
2 parents 2c00421 + 390e5cb commit 7635c7f
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 35 deletions.
64 changes: 64 additions & 0 deletions one_fm/fixtures/assignment_rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,70 @@
"unassign_condition": "status == \"Cancelled\"",
"users": []
},
{
"assign_condition": "status in (\"Pending\", \"Overdue\")",
"assignment_days": [
{
"day": "Sunday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Monday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Tuesday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Wednesday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Thursday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Friday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
},
{
"day": "Saturday",
"parent": "Post Schedule Checker - Site Supervisor",
"parentfield": "assignment_days",
"parenttype": "Assignment Rule"
}
],
"close_condition": "status == \"Completed\"",
"custom_routine_task": null,
"description": "<p>Here is to inform you that the following {{ doctype }}({{ name }}) requires your attention/action.\n <br>\n The details of the request are as follows:\n <br>\n </p><table cellpadding=\"0\" cellspacing=\"0\" border=\"1\" style=\"border-collapse: collapse;\">\n <thead>\n <tr>\n <th style=\"padding: 10px; text-align: left; background-color: #f2f2f2;\">Label</th>\n <th style=\"padding: 10px; text-align: left; background-color: #f2f2f2;\">Value</th>\n </tr>\n </thead>\n <tbody>\n \n <tr>\n <td style=\"padding: 10px;\">Contract</td>\n <td style=\"padding: 10px;\">{{contract}}</td>\n </tr>\n \n <tr>\n <td style=\"padding: 10px;\">Project</td>\n <td style=\"padding: 10px;\">{{project}}</td>\n </tr>\n \n <tr>\n <td style=\"padding: 10px;\">Site Supervisor</td>\n <td style=\"padding: 10px;\">{{site_supervisor}}</td>\n </tr>\n \n <tr>\n <td style=\"padding: 10px;\">Shift Supervisor</td>\n <td style=\"padding: 10px;\">{{supervisor}}</td>\n </tr>\n </tbody></table><p></p>",
"disabled": 0,
"docstatus": 0,
"doctype": "Assignment Rule",
"document_type": "Post Scheduler Checker",
"due_date_based_on": null,
"field": "site_supervisor_name",
"is_assignment_rule_with_workflow": 0,
"last_user": null,
"modified": "2024-12-23 09:00:50.687088",
"name": "Post Schedule Checker - Site Supervisor",
"priority": 0,
"rule": "Based on Field",
"unassign_condition": "status == \"Cancelled\"",
"users": []
},
{
"assign_condition": "status in (\"Pending\", \"Overdue\")",
"assignment_days": [
Expand Down
9 changes: 8 additions & 1 deletion one_fm/fixtures/doctype_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,13 @@
"parentfield": "fields",
"parenttype": "DocType Layout"
},
{
"fieldname": "custom_operations_role_allocation",
"label": "Operations Role Allocation",
"parent": "Employee",
"parentfield": "fields",
"parenttype": "DocType Layout"
},
{
"fieldname": "site",
"label": "Site",
Expand Down Expand Up @@ -1511,7 +1518,7 @@
"parenttype": "DocType Layout"
}
],
"modified": "2023-12-03 14:06:06.531161",
"modified": "2024-12-17 08:49:40.169020",
"name": "Employee",
"route": "app/employee/"
}
Expand Down
5 changes: 4 additions & 1 deletion one_fm/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,10 @@
"0 * * * *":[ # Creates the missing checkin record per shift, runs every hour
"one_fm.one_fm.doctype.missing_checkin.missing_checkin.create_missing_checkin_record",
"one_fm.api.tasks.notify_approver_about_pending_shift_request"
]
],
"0 0 15 * *": [
"one_fm.one_fm.page.roster.roster.create_employee_schedule"
]
}
}

Expand Down
Loading

0 comments on commit 7635c7f

Please sign in to comment.