From 09b6628e536321cd139052554cfadf6a16807b74 Mon Sep 17 00:00:00 2001 From: Anupam Kumar Date: Tue, 18 Aug 2020 14:43:34 +0530 Subject: [PATCH] fix: Leave application status (#23043) * fix: leave application status update fix * fix:adding patch --- .../doctype/leave_application/leave_application.json | 7 +++---- erpnext/patches.txt | 1 + .../patches/v12_0/update_leave_application_status.py | 10 ++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 erpnext/patches/v12_0/update_leave_application_status.py diff --git a/erpnext/hr/doctype/leave_application/leave_application.json b/erpnext/hr/doctype/leave_application/leave_application.json index 460be514b59..9cc9c87f7f8 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.json +++ b/erpnext/hr/doctype/leave_application/leave_application.json @@ -1,5 +1,4 @@ { - "actions": [], "allow_import": 1, "autoname": "naming_series:", "creation": "2013-02-20 11:18:11", @@ -167,6 +166,7 @@ "fieldtype": "Column Break" }, { + "allow_on_submit": 1, "default": "Open", "fieldname": "status", "fieldtype": "Select", @@ -246,9 +246,8 @@ "icon": "fa fa-calendar", "idx": 1, "is_submittable": 1, - "links": [], "max_attachments": 3, - "modified": "2020-03-10 22:40:43.487721", + "modified": "2020-08-13 17:22:44.832397", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", @@ -333,4 +332,4 @@ "sort_order": "DESC", "timeline_field": "employee", "title_field": "employee_name" -} +} \ No newline at end of file diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 51d18e83e99..831541ccb1f 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -676,3 +676,4 @@ erpnext.patches.v12_0.move_due_advance_amount_to_pending_amount erpnext.patches.v12_0.set_multi_uom_in_rfq erpnext.patches.v12_0.update_state_code_for_daman_and_diu erpnext.patches.v12_0.rename_lost_reason_detail +erpnext.patches.v12_0.update_leave_application_status diff --git a/erpnext/patches/v12_0/update_leave_application_status.py b/erpnext/patches/v12_0/update_leave_application_status.py new file mode 100644 index 00000000000..261a3a5c0cb --- /dev/null +++ b/erpnext/patches/v12_0/update_leave_application_status.py @@ -0,0 +1,10 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + # frappe.reload_doc('HR', 'doctype', 'leave_application') + frappe.db.sql(""" + UPDATE `tabLeave Application` SET + status = 'Cancelled' + WHERE status = 'Approved' and docstatus = 2 + """) \ No newline at end of file