Added webform for Job Opening

This commit is contained in:
Kanchan Chauhan
2016-02-19 17:27:23 +05:30
parent 8fdd4e7b54
commit 2e8cc89e34
8 changed files with 107 additions and 6 deletions

View File

@@ -108,7 +108,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "job_opening",
"fieldname": "job_title",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -184,7 +184,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-02-12 00:38:31.773297",
"modified": "2016-02-19 16:43:24.705867",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Applicant",
@@ -204,11 +204,33 @@
"print": 1,
"read": 1,
"report": 1,
"restrict": 0,
"restricted": 0,
"role": "HR User",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Guest",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}
],
"read_only": 0,

View File

@@ -7,10 +7,12 @@ from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe import _
from frappe.utils import comma_and
from frappe.utils import comma_and, validate_email_add
sender_field = "email_id"
class DuplicationError(frappe.ValidationError): pass
class JobApplicant(Document):
def onload(self):
offer_letter = frappe.get_all("Offer Letter", filters={"job_applicant": self.name})
@@ -25,6 +27,14 @@ class JobApplicant(Document):
def validate(self):
self.check_email_id_is_unique()
validate_email_add(self.email_id, True)
if frappe.db.sql("""select applicant_name from `tabJob Applicant` where email_id= %s and job_title= %s""",
(self.email_id, self.job_title)):
frappe.throw(_("Application already exist for {0} against Job Opening - {1}")
.format(self.applicant_name, self.job_title), DuplicationError)
if not self.get("__islocal") and not self.upload_cv:
frappe.throw(_("CV Required"))
def check_email_id_is_unique(self):
if self.email_id:
@@ -33,3 +43,5 @@ class JobApplicant(Document):
if names:
frappe.throw(_("Email id must be unique, already exists for {0}").format(comma_and(names)), frappe.DuplicateEntryError)

View File

@@ -25,6 +25,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@@ -48,6 +49,7 @@
"options": "Open\nClosed",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -71,6 +73,7 @@
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@@ -89,7 +92,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2015-11-16 06:29:48.769149",
"modified": "2016-02-17 17:29:04.401527",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Opening",
@@ -114,8 +117,29 @@
"share": 1,
"submit": 0,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Guest",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}
],
"read_only": 0,
"read_only_onload": 0
"read_only_onload": 0,
"sort_order": "ASC"
}