From eb4fd6d44f8239689439071296504816921da01e Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Fri, 13 Mar 2026 11:10:13 +0530 Subject: [PATCH 1/9] fix(leave application): show to_date, leave_type in list view & rename date section to leave details --- hrms/hr/doctype/leave_application/leave_application.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hrms/hr/doctype/leave_application/leave_application.json b/hrms/hr/doctype/leave_application/leave_application.json index 8d1b762a1f..e5aad6cd45 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,6 +21,7 @@ "half_day_date", "total_leave_days", "column_break1", + "leave_type", "description", "leave_balance", "section_break_7", @@ -75,6 +75,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 +100,7 @@ { "fieldname": "section_break_5", "fieldtype": "Section Break", - "label": "Dates & Reason" + "label": "Leave Details" }, { "fieldname": "from_date", @@ -112,6 +113,7 @@ { "fieldname": "to_date", "fieldtype": "Date", + "in_list_view": 1, "label": "To Date", "reqd": 1, "search_index": 1 @@ -255,7 +257,7 @@ "is_submittable": 1, "links": [], "max_attachments": 3, - "modified": "2026-01-27 12:02:51.679025", + "modified": "2026-03-13 08:47:19.783060", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", From d01e36e4fa2d5683ce67c18a12521a3bf179f2b0 Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Fri, 13 Mar 2026 11:11:15 +0530 Subject: [PATCH 2/9] fix(leave_allocation): show total_leaves_allocated in list view --- hrms/hr/doctype/leave_allocation/leave_allocation.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hrms/hr/doctype/leave_allocation/leave_allocation.json b/hrms/hr/doctype/leave_allocation/leave_allocation.json index ed01b8bdbc..9b38113aaf 100644 --- a/hrms/hr/doctype/leave_allocation/leave_allocation.json +++ b/hrms/hr/doctype/leave_allocation/leave_allocation.json @@ -136,6 +136,7 @@ "allow_on_submit": 1, "fieldname": "total_leaves_allocated", "fieldtype": "Float", + "in_list_view": 1, "label": "Total Leaves Allocated", "read_only": 1, "reqd": 1 @@ -258,7 +259,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-11-12 12:54:03.589896", + "modified": "2026-03-13 09:58:07.547194", "modified_by": "Administrator", "module": "HR", "name": "Leave Allocation", From c96ee17189a6ac33582d17d3ab5c64264b801f0a Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Fri, 13 Mar 2026 11:12:28 +0530 Subject: [PATCH 3/9] fix(leave_type): enable connection tab & remove name from list view --- hrms/hr/doctype/leave_type/leave_type.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 +} From 98889cbe53ed4b9077559674e4c01056e3d589fb Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Fri, 13 Mar 2026 17:23:40 +0530 Subject: [PATCH 4/9] fix(test): prevent submitting leave type as it is not submittable --- .../test_leave_policy_assignment.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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..61c5c2228b 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( { From 662a9545f971289ccf30d1bb80a20701877bd55f Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Mon, 16 Mar 2026 12:26:22 +0530 Subject: [PATCH 5/9] fix(leave_application): add common leave reasons, add approve reject button --- .../leave_application/leave_application.js | 15 +++++++++++ .../leave_application/leave_application.json | 14 +++++++--- .../leave_application/leave_application.py | 3 ++- .../test_leave_policy_assignment.py | 2 +- hrms/workspace_sidebar/leaves.json | 26 +++++++++---------- 5 files changed, 42 insertions(+), 18 deletions(-) diff --git a/hrms/hr/doctype/leave_application/leave_application.js b/hrms/hr/doctype/leave_application/leave_application.js index 4a0bb09f34..711b1723e3 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 e5aad6cd45..18d67b7407 100644 --- a/hrms/hr/doctype/leave_application/leave_application.json +++ b/hrms/hr/doctype/leave_application/leave_application.json @@ -23,6 +23,7 @@ "column_break1", "leave_type", "description", + "specify_reason", "leave_balance", "section_break_7", "leave_approver", @@ -147,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", @@ -250,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", @@ -257,7 +265,7 @@ "is_submittable": 1, "links": [], "max_attachments": 3, - "modified": "2026-03-13 08:47:19.783060", + "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..8090515edd 100755 --- a/hrms/hr/doctype/leave_application/leave_application.py +++ b/hrms/hr/doctype/leave_application/leave_application.py @@ -79,7 +79,7 @@ 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 +94,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_policy_assignment/test_leave_policy_assignment.py b/hrms/hr/doctype/leave_policy_assignment/test_leave_policy_assignment.py index 61c5c2228b..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 @@ -172,7 +172,7 @@ def test_get_leaves_for_passed_months(self): def test_pro_rated_leave_allocation_for_custom_date_range(self): leave_type = create_leave_type( - leave_type_name="_Test Leave Type_", is_earned_leave=True, allocate_on_day="First Day" + leave_type_name="_Test Leave Type_", is_earned_leave=True, allocate_on_day="First Day" ) leave_policy = frappe.get_doc( 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", From 3e9eede488e58b926fd287c39aafe3c2fd2c3c74 Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Mon, 16 Mar 2026 12:30:10 +0530 Subject: [PATCH 6/9] fix: linter --- .../leave_application/leave_application.js | 6 +++--- .../leave_application/leave_application.py | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hrms/hr/doctype/leave_application/leave_application.js b/hrms/hr/doctype/leave_application/leave_application.js index 711b1723e3..473b93b215 100755 --- a/hrms/hr/doctype/leave_application/leave_application.js +++ b/hrms/hr/doctype/leave_application/leave_application.js @@ -297,7 +297,7 @@ frappe.ui.form.on("Leave Application", { frm.trigger("get_leave_balance"); }, - add_approval_action: function(frm){ + add_approval_action: function (frm) { if (frm.doc.status === "Open") { frm.add_custom_button(__("Approve"), () => { frm.set_value("status", "Approved"); @@ -307,9 +307,9 @@ frappe.ui.form.on("Leave Application", { 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.py b/hrms/hr/doctype/leave_application/leave_application.py index 8090515edd..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.Literal["", "Sick", "Doctor / Medical Appointment", "Personal Work", "Study / Exams", "Travelling", "Vacation", "Getting Married", "Wedding / Family Function", "Family Emergency", "Break", "Grievance leave", "Other (Specify)"] + 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 From 4bdfd6da3759e6717d146425f2d258605b4591b7 Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Mon, 16 Mar 2026 12:37:12 +0530 Subject: [PATCH 7/9] fix(leave_allocation): add connection tab --- .../hr/doctype/leave_allocation/leave_allocation.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hrms/hr/doctype/leave_allocation/leave_allocation.json b/hrms/hr/doctype/leave_allocation/leave_allocation.json index 9b38113aaf..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": [ { @@ -252,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", @@ -259,7 +266,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-03-13 09:58:07.547194", + "modified": "2026-03-16 12:33:09.010233", "modified_by": "Administrator", "module": "HR", "name": "Leave Allocation", From 9af186a8cec36a598d616e5fe42364ca09b5e07e Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Mon, 16 Mar 2026 13:14:03 +0530 Subject: [PATCH 8/9] fix(test): update leave reason --- .../test_leave_application.py | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) 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, ) From d9147a52e66549b8f47a529d37493de35d7de2b6 Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Mon, 16 Mar 2026 13:17:28 +0530 Subject: [PATCH 9/9] fix: remove unnecessary colum in list view of leave block and holiday assingment --- .../holiday_list_assignment/holiday_list_assignment.json | 3 +-- hrms/hr/doctype/leave_block_list/leave_block_list.json | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) 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_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 +}