-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Reliever Assignment doctype to transfer responsibilites
- Loading branch information
Showing
9 changed files
with
503 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
18 changes: 18 additions & 0 deletions
18
one_fm/one_fm/doctype/reliever_assignment/reliever_assignment.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024, omar jaber and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on("Reliever Assignment", { | ||
setup (frm) { | ||
let today = moment().format("YYYY-MM-DD"); | ||
frm.set_query("leave_application", () => { | ||
return { | ||
filters: { | ||
workflow_state: "Approved", | ||
from_date: ["<=", today], | ||
to_date: [">=", today], | ||
custom_reliever_ : ["is", "set"] | ||
} | ||
} | ||
}) | ||
}, | ||
}); |
137 changes: 137 additions & 0 deletions
137
one_fm/one_fm/doctype/reliever_assignment/reliever_assignment.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"autoname": "field:leave_application", | ||
"creation": "2024-10-29 07:06:44.888238", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"leave_details_section", | ||
"leave_application", | ||
"assignment_period_start", | ||
"assignment_period_end", | ||
"column_break_yubw", | ||
"on_leave_employee", | ||
"on_leave_employee_name", | ||
"reliever", | ||
"reliever_name", | ||
"section_break_plav", | ||
"assigned_documents" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "leave_details_section", | ||
"fieldtype": "Section Break", | ||
"label": "Leave Details" | ||
}, | ||
{ | ||
"fieldname": "leave_application", | ||
"fieldtype": "Link", | ||
"in_standard_filter": 1, | ||
"label": "Leave Application", | ||
"options": "Leave Application", | ||
"unique": 1 | ||
}, | ||
{ | ||
"fetch_from": "leave_application.from_date", | ||
"fetch_if_empty": 1, | ||
"fieldname": "assignment_period_start", | ||
"fieldtype": "Date", | ||
"in_list_view": 1, | ||
"label": "Assignment Period Start", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fetch_from": "leave_application.to_date", | ||
"fetch_if_empty": 1, | ||
"fieldname": "assignment_period_end", | ||
"fieldtype": "Date", | ||
"in_list_view": 1, | ||
"label": "Assignment Period End", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "column_break_yubw", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fetch_from": "leave_application.employee", | ||
"fetch_if_empty": 1, | ||
"fieldname": "on_leave_employee", | ||
"fieldtype": "Link", | ||
"in_standard_filter": 1, | ||
"label": "On Leave Employee", | ||
"options": "Employee", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fetch_from": "leave_application.employee_name", | ||
"fetch_if_empty": 1, | ||
"fieldname": "on_leave_employee_name", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "On Leave Employee Name", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fetch_from": "leave_application.custom_reliever_", | ||
"fetch_if_empty": 1, | ||
"fieldname": "reliever", | ||
"fieldtype": "Link", | ||
"in_standard_filter": 1, | ||
"label": "Reliever", | ||
"options": "Employee", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fetch_from": "leave_application.custom_reliever_name", | ||
"fetch_if_empty": 1, | ||
"fieldname": "reliever_name", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Reliever Name", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "section_break_plav", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "assigned_documents", | ||
"fieldtype": "Table", | ||
"label": "Assigned Documents", | ||
"options": "Reliever Assignment Document", | ||
"read_only": 1 | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"links": [ | ||
{ | ||
"link_doctype": "Leave Application", | ||
"link_fieldname": "name" | ||
} | ||
], | ||
"modified": "2024-10-29 13:02:58.788519", | ||
"modified_by": "Administrator", | ||
"module": "One Fm", | ||
"name": "Reliever Assignment", | ||
"naming_rule": "By fieldname", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"write": 1 | ||
} | ||
], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
Oops, something went wrong.