2021-10-01 07:45:40 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import frappe
|
|
|
|
from frappe import _
|
|
|
|
|
|
|
|
|
|
|
|
def execute():
|
|
|
|
if not frappe.db.exists('Email Template', _('Interview Reminder')):
|
|
|
|
base_path = frappe.get_app_path('erpnext', 'hr', 'doctype')
|
|
|
|
response = frappe.read_file(os.path.join(base_path, 'interview/interview_reminder_notification_template.html'))
|
|
|
|
|
|
|
|
frappe.get_doc({
|
|
|
|
'doctype': 'Email Template',
|
|
|
|
'name': _('Interview Reminder'),
|
|
|
|
'response': response,
|
|
|
|
'subject': _('Interview Reminder'),
|
|
|
|
'owner': frappe.session.user,
|
|
|
|
}).insert(ignore_permissions=True)
|
|
|
|
|
|
|
|
if not frappe.db.exists('Email Template', _('Interview Feedback Reminder')):
|
|
|
|
base_path = frappe.get_app_path('erpnext', 'hr', 'doctype')
|
|
|
|
response = frappe.read_file(os.path.join(base_path, 'interview/interview_feedback_reminder_template.html'))
|
|
|
|
|
|
|
|
frappe.get_doc({
|
|
|
|
'doctype': 'Email Template',
|
|
|
|
'name': _('Interview Feedback Reminder'),
|
|
|
|
'response': response,
|
|
|
|
'subject': _('Interview Feedback Reminder'),
|
|
|
|
'owner': frappe.session.user,
|
|
|
|
}).insert(ignore_permissions=True)
|
|
|
|
|
|
|
|
hr_settings = frappe.get_doc('HR Settings')
|
|
|
|
hr_settings.interview_reminder_template = _('Interview Reminder')
|
|
|
|
hr_settings.feedback_reminder_notification_template = _('Interview Feedback Reminder')
|
2021-12-24 11:50:23 +00:00
|
|
|
hr_settings.flags.ignore_links = True
|
2021-10-01 07:45:40 +00:00
|
|
|
hr_settings.save()
|