feat: Exit Interview

This commit is contained in:
Rucha Mahabal 2021-12-05 14:42:27 +05:30
parent 0ef42d1000
commit 36a2d8ee0d
5 changed files with 235 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Exit Interview', {
refresh: function(frm) {
},
employee: function(frm) {
frappe.db.get_value('Employee', frm.doc.employee, 'relieving_date').then(({ relieving_date }) => {
if (!relieving_date) {
frappe.throw({
message: __('Please set the relieving date for employee {0}',
['<a href="/app/employee/' + frm.doc.employee +'">' + frm.doc.employee + '</a>']),
title: __('Relieving Date Missing')
});
}
});
}
});

View File

@ -0,0 +1,190 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "naming_series:",
"creation": "2021-12-05 13:56:36.241690",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"naming_series",
"employee",
"employee_name",
"column_break_5",
"company",
"date",
"employee_details_section",
"department",
"designation",
"reports_to",
"column_break_9",
"date_of_joining",
"relieving_date",
"exit_questionnaire_section",
"ref_doctype",
"column_break_10",
"reference_document_name",
"interview_summary_section",
"interviewers",
"text_editor_12"
],
"fields": [
{
"fieldname": "employee",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Employee",
"options": "Employee",
"reqd": 1
},
{
"fetch_from": "employee.employee_name",
"fieldname": "employee_name",
"fieldtype": "Data",
"label": "Employee Name",
"read_only": 1
},
{
"fetch_from": "employee.department",
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Department",
"read_only": 1
},
{
"fetch_from": "employee.relieving_date",
"fieldname": "relieving_date",
"fieldtype": "Date",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Relieving Date",
"read_only": 1
},
{
"fieldname": "column_break_5",
"fieldtype": "Column Break"
},
{
"fieldname": "company",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Company",
"options": "Company",
"reqd": 1
},
{
"fieldname": "date",
"fieldtype": "Date",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Date",
"reqd": 1
},
{
"fieldname": "exit_questionnaire_section",
"fieldtype": "Section Break",
"label": "Exit Questionnaire"
},
{
"fieldname": "ref_doctype",
"fieldtype": "Link",
"label": "Reference Document Type",
"options": "DocType"
},
{
"fieldname": "reference_document_name",
"fieldtype": "Dynamic Link",
"in_list_view": 1,
"label": "Reference Document Name",
"options": "ref_doctype"
},
{
"fieldname": "interview_summary_section",
"fieldtype": "Section Break",
"label": "Interview Details"
},
{
"fieldname": "text_editor_12",
"fieldtype": "Text Editor",
"label": "Interview Summary"
},
{
"fieldname": "column_break_10",
"fieldtype": "Column Break"
},
{
"fieldname": "interviewers",
"fieldtype": "Table MultiSelect",
"label": "Interviewers",
"options": "Interviewer",
"reqd": 1
},
{
"fetch_from": "employee.date_of_joining",
"fieldname": "date_of_joining",
"fieldtype": "Date",
"label": "Date of Joining",
"read_only": 1
},
{
"fieldname": "reports_to",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Reports To",
"options": "Employee",
"read_only": 1
},
{
"fieldname": "employee_details_section",
"fieldtype": "Section Break",
"label": "Employee Details"
},
{
"fetch_from": "employee.designation",
"fieldname": "designation",
"fieldtype": "Link",
"label": "Designation",
"options": "Designation",
"read_only": 1
},
{
"fieldname": "column_break_9",
"fieldtype": "Column Break"
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Naming Series",
"options": "HR-EXIT-INT-"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-12-05 14:25:40.416023",
"modified_by": "Administrator",
"module": "HR",
"name": "Exit Interview",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "employee_name",
"track_changes": 1
}

View File

@ -0,0 +1,17 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import get_link_to_form
class ExitInterview(Document):
def validate(self):
self.validate_relieving_date()
def validate_relieving_date(self):
if not frappe.db.get_value('Employee', self.employee, 'relieving_date'):
frappe.throw(_('Please set the relieving date for employee {0}').format(
get_link_to_form('Employee', self.employee)),
title=_('Relieving Date Missing'))

View File

@ -0,0 +1,8 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
class TestExitInterview(unittest.TestCase):
pass