From b07c1f3bf1f56c809d443c3be7038c1117ed6e77 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 17 Jan 2022 14:37:25 +0530 Subject: [PATCH] feat: add link to leave application in leave notification (#29316) --- .../leave_application_email_template.html | 5 +++++ erpnext/patches.txt | 1 + .../v14_0/update_leave_notification_template.py | 17 +++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 erpnext/patches/v14_0/update_leave_notification_template.py diff --git a/erpnext/hr/doctype/leave_application/leave_application_email_template.html b/erpnext/hr/doctype/leave_application/leave_application_email_template.html index 14ca41bebc..dae9084f79 100644 --- a/erpnext/hr/doctype/leave_application/leave_application_email_template.html +++ b/erpnext/hr/doctype/leave_application/leave_application_email_template.html @@ -23,3 +23,8 @@ {{status}} + + {% set doc_link = frappe.utils.get_url_to_form('Leave Application', name) %} + +

+ {{ _('Open Now') }} \ No newline at end of file diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d56aa6d35a..fa62b7fc27 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -326,3 +326,4 @@ erpnext.patches.v13_0.agriculture_deprecation_warning erpnext.patches.v14_0.delete_agriculture_doctypes erpnext.patches.v13_0.update_exchange_rate_settings erpnext.patches.v14_0.rearrange_company_fields +erpnext.patches.v14_0.update_leave_notification_template \ No newline at end of file diff --git a/erpnext/patches/v14_0/update_leave_notification_template.py b/erpnext/patches/v14_0/update_leave_notification_template.py new file mode 100644 index 0000000000..e744054a2f --- /dev/null +++ b/erpnext/patches/v14_0/update_leave_notification_template.py @@ -0,0 +1,17 @@ +import os + +import frappe +from frappe import _ + + +def execute(): + base_path = frappe.get_app_path("erpnext", "hr", "doctype") + response = frappe.read_file(os.path.join(base_path, "leave_application/leave_application_email_template.html")) + + template = frappe.db.exists("Email Template", _("Leave Approval Notification")) + if template: + frappe.db.set_value("Email Template", template, "response", response) + + template = frappe.db.exists("Email Template", _("Leave Status Notification")) + if template: + frappe.db.set_value("Email Template", template, "response", response)