[fix] job applicant (test via import)

This commit is contained in:
Rushabh Mehta 2015-03-23 15:44:37 +05:30
parent fea22de3e8
commit 04f907efcf
3 changed files with 26 additions and 4 deletions

View File

@ -1,5 +1,5 @@
{ {
"autoname": "field:applicant_name", "autoname": "",
"creation": "2013-01-29 19:25:37", "creation": "2013-01-29 19:25:37",
"description": "Applicant for a Job", "description": "Applicant for a Job",
"docstatus": 0, "docstatus": 0,
@ -12,12 +12,13 @@
"in_list_view": 0, "in_list_view": 0,
"label": "Applicant Name", "label": "Applicant Name",
"permlevel": 0, "permlevel": 0,
"reqd": 1 "reqd": 0
}, },
{ {
"fieldname": "email_id", "fieldname": "email_id",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Email Id", "label": "Email Id",
"options": "Email",
"permlevel": 0 "permlevel": 0
}, },
{ {
@ -65,7 +66,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2015-02-05 05:11:40.029237", "modified": "2015-03-23 05:42:02.016041",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Job Applicant", "name": "Job Applicant",

View File

@ -5,6 +5,15 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from frappe.model.document import Document from frappe.model.document import Document
import frappe
from frappe import _
class JobApplicant(Document): 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

View 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