feat: add link to leave application in leave notification (#29316)

This commit is contained in:
Rucha Mahabal 2022-01-17 14:37:25 +05:30 committed by GitHub
parent 3db8d908dc
commit b07c1f3bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 0 deletions

View File

@ -23,3 +23,8 @@
<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>

View File

@ -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

View File

@ -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)