[fix] job applicant (test via import)
This commit is contained in:
		
							parent
							
								
									fea22de3e8
								
							
						
					
					
						commit
						04f907efcf
					
				| @ -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",  | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
							
								
								
									
										12
									
								
								erpnext/hr/doctype/job_applicant/test_job_applicant.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								erpnext/hr/doctype/job_applicant/test_job_applicant.py
									
									
									
									
									
										Normal file
									
								
							| @ -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 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user