brotherton-erpnext/erpnext/patches/v14_0/update_leave_notification_template.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
576 B
Python
Raw Normal View History

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")
2022-03-28 13:22:46 +00:00
)
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)