Skip to content

Commit

Permalink
feat: add link to leave application in leave notification (#29316)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed Jan 17, 2022
1 parent 3db8d90 commit b07c1f3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ <h3>Details:</h3>
<td>{{status}}</td>
</tr>
</table>

{% set doc_link = frappe.utils.get_url_to_form('Leave Application', name) %}

<br><br>
<a class="btn btn-primary" href="{{ doc_link }}" target="_blank">{{ _('Open Now') }}</a>
1 change: 1 addition & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions erpnext/patches/v14_0/update_leave_notification_template.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit b07c1f3

Please sign in to comment.