diff --git a/hrms/hr/doctype/holiday_list_assignment/holiday_list_assignment.json b/hrms/hr/doctype/holiday_list_assignment/holiday_list_assignment.json index 4be2a24645..429c6fe44b 100644 --- a/hrms/hr/doctype/holiday_list_assignment/holiday_list_assignment.json +++ b/hrms/hr/doctype/holiday_list_assignment/holiday_list_assignment.json @@ -44,7 +44,6 @@ { "fieldname": "naming_series", "fieldtype": "Select", - "in_list_view": 1, "label": "Naming Series", "options": "HR-HLA-.YYYY.-", "reqd": 1 @@ -107,7 +106,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-01-07 16:11:21.856458", + "modified": "2026-03-16 12:43:14.826131", "modified_by": "Administrator", "module": "HR", "name": "Holiday List Assignment", diff --git a/hrms/hr/doctype/leave_allocation/leave_allocation.json b/hrms/hr/doctype/leave_allocation/leave_allocation.json index ed01b8bdbc..631f99d6e7 100644 --- a/hrms/hr/doctype/leave_allocation/leave_allocation.json +++ b/hrms/hr/doctype/leave_allocation/leave_allocation.json @@ -34,7 +34,8 @@ "earned_leave_schedule", "retry_failed_allocations", "notes", - "description" + "description", + "connection_tab" ], "fields": [ { @@ -136,6 +137,7 @@ "allow_on_submit": 1, "fieldname": "total_leaves_allocated", "fieldtype": "Float", + "in_list_view": 1, "label": "Total Leaves Allocated", "read_only": 1, "reqd": 1 @@ -251,6 +253,12 @@ "fieldtype": "Button", "hidden": 1, "label": "Retry Failed Allocations" + }, + { + "fieldname": "connection_tab", + "fieldtype": "Tab Break", + "label": "Connection", + "show_dashboard": 1 } ], "icon": "fa fa-ok", @@ -258,7 +266,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-11-12 12:54:03.589896", + "modified": "2026-03-16 12:33:09.010233", "modified_by": "Administrator", "module": "HR", "name": "Leave Allocation", diff --git a/hrms/hr/doctype/leave_application/leave_application.js b/hrms/hr/doctype/leave_application/leave_application.js index 4a0bb09f34..473b93b215 100755 --- a/hrms/hr/doctype/leave_application/leave_application.js +++ b/hrms/hr/doctype/leave_application/leave_application.js @@ -113,6 +113,7 @@ frappe.ui.form.on("Leave Application", { frm.trigger("make_dashboard"); } frm.trigger("set_form_buttons"); + frm.trigger("add_approval_action"); }, async set_employee(frm) { @@ -295,6 +296,20 @@ frappe.ui.form.on("Leave Application", { frm.trigger("make_dashboard"); frm.trigger("get_leave_balance"); }, + + add_approval_action: function (frm) { + if (frm.doc.status === "Open") { + frm.add_custom_button(__("Approve"), () => { + frm.set_value("status", "Approved"); + frm.save(); + }); + + frm.add_custom_button(__("Reject"), () => { + frm.set_value("status", "Rejected"); + frm.save(); + }); + } + }, }); frappe.tour["Leave Application"] = [ diff --git a/hrms/hr/doctype/leave_application/leave_application.json b/hrms/hr/doctype/leave_application/leave_application.json index 8d1b762a1f..18d67b7407 100644 --- a/hrms/hr/doctype/leave_application/leave_application.json +++ b/hrms/hr/doctype/leave_application/leave_application.json @@ -12,7 +12,6 @@ "employee", "employee_name", "column_break_4", - "leave_type", "company", "department", "section_break_5", @@ -22,7 +21,9 @@ "half_day_date", "total_leave_days", "column_break1", + "leave_type", "description", + "specify_reason", "leave_balance", "section_break_7", "leave_approver", @@ -75,6 +76,7 @@ "fieldname": "leave_type", "fieldtype": "Link", "ignore_user_permissions": 1, + "in_list_view": 1, "in_standard_filter": 1, "label": "Leave Type", "options": "Leave Type", @@ -99,7 +101,7 @@ { "fieldname": "section_break_5", "fieldtype": "Section Break", - "label": "Dates & Reason" + "label": "Leave Details" }, { "fieldname": "from_date", @@ -112,6 +114,7 @@ { "fieldname": "to_date", "fieldtype": "Date", + "in_list_view": 1, "label": "To Date", "reqd": 1, "search_index": 1 @@ -145,8 +148,9 @@ }, { "fieldname": "description", - "fieldtype": "Small Text", - "label": "Reason" + "fieldtype": "Select", + "label": "Reason", + "options": "\nSick\nDoctor / Medical Appointment\nPersonal Work\nStudy / Exams\nTravelling\nVacation\nGetting Married\nWedding / Family Function\nFamily Emergency\nBreak\nGrievance leave\nOther (Specify)" }, { "fieldname": "section_break_7", @@ -248,6 +252,12 @@ "fieldname": "sb_other_details", "fieldtype": "Section Break", "label": "Other Details" + }, + { + "depends_on": "eval: doc.description == \"Other (Specify)\"", + "fieldname": "specify_reason", + "fieldtype": "Small Text", + "label": "Specify Reason" } ], "icon": "fa fa-calendar", @@ -255,7 +265,7 @@ "is_submittable": 1, "links": [], "max_attachments": 3, - "modified": "2026-01-27 12:02:51.679025", + "modified": "2026-03-16 12:22:47.066429", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", diff --git a/hrms/hr/doctype/leave_application/leave_application.py b/hrms/hr/doctype/leave_application/leave_application.py index 6b09ea88b1..17a0850be5 100755 --- a/hrms/hr/doctype/leave_application/leave_application.py +++ b/hrms/hr/doctype/leave_application/leave_application.py @@ -79,7 +79,21 @@ class LeaveApplication(Document, PWANotificationsMixin): color: DF.Color | None company: DF.Link department: DF.Link | None - description: DF.SmallText | None + description: DF.Literal[ + "", + "Sick", + "Doctor / Medical Appointment", + "Personal Work", + "Study / Exams", + "Travelling", + "Vacation", + "Getting Married", + "Wedding / Family Function", + "Family Emergency", + "Break", + "Grievance leave", + "Other (Specify)", + ] employee: DF.Link employee_name: DF.Data | None follow_via_email: DF.Check @@ -94,6 +108,7 @@ class LeaveApplication(Document, PWANotificationsMixin): naming_series: DF.Literal["HR-LAP-.YYYY.-"] posting_date: DF.Date salary_slip: DF.Link | None + specify_reason: DF.SmallText | None status: DF.Literal["Open", "Approved", "Rejected", "Cancelled"] to_date: DF.Date total_leave_days: DF.Float diff --git a/hrms/hr/doctype/leave_application/test_leave_application.py b/hrms/hr/doctype/leave_application/test_leave_application.py index 95830dbef2..1e870abb55 100644 --- a/hrms/hr/doctype/leave_application/test_leave_application.py +++ b/hrms/hr/doctype/leave_application/test_leave_application.py @@ -65,7 +65,8 @@ def make_leave_applications(cls): "doctype": "Leave Application", "employee": "_T-Employee-00001", "from_date": "2013-05-01", - "description": "_Test Reason", + "description": "Other (Specify)", + "specify_reason": "_Test Reason", "leave_type": "_Test Leave Type", "posting_date": "2013-01-02", "to_date": "2013-05-05", @@ -75,7 +76,8 @@ def make_leave_applications(cls): "doctype": "Leave Application", "employee": "_T-Employee-00002", "from_date": "2013-05-01", - "description": "_Test Reason", + "description": "Other (Specify)", + "specify_reason": "_Test Reason", "leave_type": "_Test Leave Type", "posting_date": "2013-01-02", "to_date": "2013-05-05", @@ -85,7 +87,8 @@ def make_leave_applications(cls): "doctype": "Leave Application", "employee": "_T-Employee-00001", "from_date": "2013-01-15", - "description": "_Test Reason", + "description": "Other (Specify)", + "specify_reason": "_Test Reason", "leave_type": "_Test Leave Type LWP", "posting_date": "2013-01-02", "to_date": "2013-01-15", @@ -603,7 +606,8 @@ def test_optional_leave(self): doctype="Leave Application", employee=employee.name, company="_Test Company", - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", leave_type=leave_type, from_date=date, to_date=date, @@ -638,7 +642,8 @@ def test_leaves_allowed(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type.name, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date=date, to_date=add_days(date, 2), company="_Test Company", @@ -653,7 +658,8 @@ def test_leaves_allowed(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type.name, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date=add_days(date, 4), to_date=add_days(date, 8), company="_Test Company", @@ -679,7 +685,8 @@ def test_applicable_after(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type.name, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date=date, to_date=add_days(date, 4), company="_Test Company", @@ -702,7 +709,8 @@ def test_applicable_after(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type_1.name, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date=date, to_date=add_days(date, 4), company="_Test Company", @@ -736,7 +744,8 @@ def test_max_continuous_leaves(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type.name, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date=date, to_date=add_days(date, 4), company="_Test Company", @@ -846,7 +855,8 @@ def test_current_leave_on_submit(self): doctype="Leave Application", employee=employee.name, leave_type=leave_type, - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", from_date="2018-10-02", to_date="2018-10-02", company="_Test Company", @@ -914,7 +924,8 @@ def test_ledger_entry_creation_on_intermediate_allocation_expiry(self): to_date=add_days(nowdate(), 7), half_day=1, half_day_date=add_days(nowdate(), -3), - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", company="_Test Company", docstatus=1, status="Approved", @@ -1013,7 +1024,8 @@ def test_self_leave_approval_allowed(self): from_date="2014-06-01", to_date="2014-06-02", posting_date="2014-05-30", - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", company="_Test Company", leave_approver="test@example.com", ) @@ -1051,7 +1063,8 @@ def test_self_leave_approval_not_allowed(self): from_date="2014-06-03", to_date="2014-06-04", posting_date="2014-05-30", - description="_Test Reason", + description="Other (Specify)", + specify_reason="_Test Reason", company="_Test Company", leave_approver=leave_approver, ) diff --git a/hrms/hr/doctype/leave_block_list/leave_block_list.json b/hrms/hr/doctype/leave_block_list/leave_block_list.json index 3e208f2df9..7937ed3848 100644 --- a/hrms/hr/doctype/leave_block_list/leave_block_list.json +++ b/hrms/hr/doctype/leave_block_list/leave_block_list.json @@ -23,7 +23,6 @@ { "fieldname": "leave_block_list_name", "fieldtype": "Data", - "in_list_view": 1, "label": "Leave Block List Name", "reqd": 1, "unique": 1 @@ -89,7 +88,7 @@ "icon": "fa fa-calendar", "idx": 1, "links": [], - "modified": "2024-03-27 13:10:00.587073", + "modified": "2026-03-16 12:48:24.559364", "modified_by": "Administrator", "module": "HR", "name": "Leave Block List", @@ -106,7 +105,8 @@ "write": 1 } ], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "ASC", "states": [] -} \ No newline at end of file +} diff --git a/hrms/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py b/hrms/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py index 19f1e7ca1c..c1ae57d857 100644 --- a/hrms/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py +++ b/hrms/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py @@ -171,15 +171,9 @@ def test_get_leaves_for_passed_months(self): self.assertEqual(new_leaves_allocated, 20) def test_pro_rated_leave_allocation_for_custom_date_range(self): - leave_type = frappe.get_doc( - { - "doctype": "Leave Type", - "leave_type_name": "_Test Leave Type_", - "include_holiday": 1, - "is_earned_leave": 1, - "allocate_on_day": "First Day", - } - ).submit() + leave_type = create_leave_type( + leave_type_name="_Test Leave Type_", is_earned_leave=True, allocate_on_day="First Day" + ) leave_policy = frappe.get_doc( { diff --git a/hrms/hr/doctype/leave_type/leave_type.json b/hrms/hr/doctype/leave_type/leave_type.json index a5bd6b6a51..04302516de 100644 --- a/hrms/hr/doctype/leave_type/leave_type.json +++ b/hrms/hr/doctype/leave_type/leave_type.json @@ -36,13 +36,13 @@ "earned_leave_frequency", "column_break_22", "allocate_on_day", - "rounding" + "rounding", + "connections_tab" ], "fields": [ { "fieldname": "leave_type_name", "fieldtype": "Data", - "in_list_view": 1, "label": "Leave Type Name", "oldfieldname": "leave_type_name", "oldfieldtype": "Data", @@ -230,12 +230,18 @@ "fieldtype": "Int", "label": "Non-Encashable Leaves", "non_negative": 1 + }, + { + "fieldname": "connections_tab", + "fieldtype": "Tab Break", + "label": "Connections", + "show_dashboard": 1 } ], "icon": "fa fa-flag", "idx": 1, "links": [], - "modified": "2024-12-18 19:51:44.162375", + "modified": "2026-03-13 10:37:13.489375", "modified_by": "Administrator", "module": "HR", "name": "Leave Type", @@ -269,8 +275,9 @@ "role": "Employee" } ], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/hrms/workspace_sidebar/leaves.json b/hrms/workspace_sidebar/leaves.json index c832f4ea99..b84ea728e8 100644 --- a/hrms/workspace_sidebar/leaves.json +++ b/hrms/workspace_sidebar/leaves.json @@ -30,18 +30,6 @@ "show_arrow": 0, "type": "Link" }, - { - "child": 0, - "collapsible": 1, - "icon": "money-coins-1", - "indent": 0, - "keep_closed": 0, - "label": "Leave Encashment", - "link_to": "Leave Encashment", - "link_type": "DocType", - "show_arrow": 0, - "type": "Link" - }, { "child": 1, "collapsible": 1, @@ -78,6 +66,18 @@ "show_arrow": 0, "type": "Link" }, + { + "child": 0, + "collapsible": 1, + "icon": "money-coins-1", + "indent": 0, + "keep_closed": 0, + "label": "Leave Encashment", + "link_to": "Leave Encashment", + "link_type": "DocType", + "show_arrow": 0, + "type": "Link" + }, { "child": 0, "collapsible": 1, @@ -221,7 +221,7 @@ "type": "Link" } ], - "modified": "2026-01-12 14:12:08.828397", + "modified": "2026-03-16 11:20:54.673263", "modified_by": "Administrator", "module": "HR", "name": "Leaves",