[fix] job applicant (test via import)
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.json b/erpnext/hr/doctype/job_applicant/job_applicant.json
index 8f92a03..fbedc1f 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.json
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.json
@@ -1,5 +1,5 @@
{
- "autoname": "field:applicant_name",
+ "autoname": "",
"creation": "2013-01-29 19:25:37",
"description": "Applicant for a Job",
"docstatus": 0,
@@ -12,12 +12,13 @@
"in_list_view": 0,
"label": "Applicant Name",
"permlevel": 0,
- "reqd": 1
+ "reqd": 0
},
{
"fieldname": "email_id",
"fieldtype": "Data",
"label": "Email Id",
+ "options": "Email",
"permlevel": 0
},
{
@@ -65,7 +66,7 @@
],
"icon": "icon-user",
"idx": 1,
- "modified": "2015-02-05 05:11:40.029237",
+ "modified": "2015-03-23 05:42:02.016041",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Applicant",
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py
index f8ea800..eca767a 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.py
@@ -5,6 +5,15 @@
from __future__ import unicode_literals
from frappe.model.document import Document
+import frappe
+from frappe import _
class JobApplicant(Document):
- pass
+ def autoname(self):
+ keys = filter(None, (self.applicant_name, self.email_id))
+ if not keys:
+ frappe.throw(_("Name or Email is mandatory"), frappe.NameError)
+ self.name = " - ".join(keys)
+
+ def set_sender(self, sender):
+ self.email_id = sender
diff --git a/erpnext/hr/doctype/job_applicant/test_job_applicant.py b/erpnext/hr/doctype/job_applicant/test_job_applicant.py
new file mode 100644
index 0000000..3ca862b
--- /dev/null
+++ b/erpnext/hr/doctype/job_applicant/test_job_applicant.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+
+# test_records = frappe.get_test_records('Job Applicant')
+
+class TestJobApplicant(unittest.TestCase):
+ pass