Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interview changes #2160

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
3 changes: 1 addition & 2 deletions hrms/hr/doctype/interview/interview.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,11 @@ frappe.ui.form.on("Interview", {
},

interview_round: function (frm) {
frm.set_value("job_applicant", "");
frm.trigger("set_applicable_interviewers");
},

job_applicant: function (frm) {
if (!frm.doc.interview_round) {
frm.set_value("job_applicant", "");
frappe.throw(__("Select Interview Round First"));
}

Expand All @@ -221,6 +219,7 @@ frappe.ui.form.on("Interview", {
interview_round: frm.doc.interview_round || "",
},
callback: function (r) {
frm.doc.interview_details = [];
r.message.forEach((interviewer) =>
frm.add_child("interview_details", interviewer),
);
Expand Down
4 changes: 2 additions & 2 deletions hrms/hr/doctype/interview/interview.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Status",
"options": "Pending\nUnder Review\nCleared\nRejected",
"options": "Pending\nRescheduled Interview\nUnder Review\nCleared\nRejected",
"reqd": 1
},
{
Expand Down Expand Up @@ -268,4 +268,4 @@
"states": [],
"title_field": "job_applicant",
"track_changes": 1
}
}
9 changes: 8 additions & 1 deletion hrms/hr/doctype/interview/interview.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ def reschedule_interview(self, scheduled_on, from_time, to_time):
original_from_time = self.from_time
original_to_time = self.to_time

self.db_set({"scheduled_on": scheduled_on, "from_time": from_time, "to_time": to_time})
self.db_set(
{
"scheduled_on": scheduled_on,
"from_time": from_time,
"to_time": to_time,
"status": "Rescheduled Interview",
}
)
self.notify_update()

recipients = get_recipients(self.name)
Expand Down
1 change: 1 addition & 0 deletions hrms/hr/doctype/job_applicant/job_applicant.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ frappe.ui.form.on("Job Applicant", {
fieldname: "interview_round",
fieldtype: "Link",
options: "Interview Round",
read: 1,
},
],
primary_action_label: __("Create Interview"),
Expand Down
6 changes: 5 additions & 1 deletion hrms/hr/doctype/training_result/training_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ frappe.ui.form.on("Training Result", {
},

training_event: function (frm) {
if (frm.doc.training_event && !frm.doc.docstatus && !frm.doc.employees) {
if (
frm.doc.training_event &&
!frm.doc.docstatus &&
(!frm.doc.employees || frm.doc.employees.length === 0)
) {
frappe.call({
method: "hrms.hr.doctype.training_result.training_result.get_employees",
args: {
Expand Down
Loading