Offer Letter - New Doctype added and job_applicant naming changed

This commit is contained in:
Neil Trini Lasrado 2015-03-04 16:01:45 +05:30
parent d102cba71c
commit e1d620b168
7 changed files with 286 additions and 1 deletions

View File

@ -47,6 +47,11 @@ def get_data():
"name": "Job Opening",
"description": _("Opening for a Job."),
},
{
"type": "doctype",
"name": "Offer Letter",
"description": _("Offer candidate a Job."),
},
]
},
{

View File

@ -1,5 +1,9 @@
{
<<<<<<< HEAD
"autoname": "",
=======
"autoname": "JA-.######",
>>>>>>> Offer Letter - New Doctype added and job_applicant naming changed
"creation": "2013-01-29 19:25:37",
"description": "Applicant for a Job",
"docstatus": 0,
@ -66,7 +70,11 @@
],
"icon": "icon-user",
"idx": 1,
<<<<<<< HEAD
"modified": "2015-03-23 05:42:02.016041",
=======
"modified": "2015-03-04 15:30:02.663549",
>>>>>>> Offer Letter - New Doctype added and job_applicant naming changed
"modified_by": "Administrator",
"module": "HR",
"name": "Job Applicant",
@ -85,5 +93,6 @@
"share": 1,
"write": 1
}
]
],
"title_field": "applicant_name"
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
cur_frm.cscript.job_applicant = function() {
frappe.call({
doc: cur_frm.doc,
method: "set_applicant_name",
callback: function(r) {
if(!r.exe){
refresh_field("applicant_name");
}
}
});
}

View File

@ -0,0 +1,233 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "OL-.######",
"creation": "2015-03-04 14:20:17.662207",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Transaction",
"fields": [
{
"allow_on_submit": 0,
"fieldname": "job_applicant",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Job Applicant",
"no_copy": 0,
"options": "Job Applicant",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "applicant_name",
"fieldtype": "Data",
"label": "Applicant Name",
"permlevel": 0,
"precision": "",
"read_only": 1
},
{
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "Awaiting Response\nAccepted\nRejected ",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"fieldname": "desgnation",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Designation",
"no_copy": 0,
"options": "Designation",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "section_break_4",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"fieldname": "expected_joining_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Expected Joining Date",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "column_break_7",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"description": "In months.",
"fieldname": "probation_period",
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Probation Period",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "section_break_9",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"fieldname": "salary",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Salary",
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
},
{
"allow_on_submit": 0,
"fieldname": "terms",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms",
"no_copy": 0,
"options": "Terms and Conditions",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "Offer Letter",
"permlevel": 0,
"print_hide": 1,
"read_only": 1
}
],
"hide_heading": 0,
"hide_toolbar": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-03-04 15:51:12.341615",
"modified_by": "Administrator",
"module": "HR",
"name": "Offer Letter",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
"apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 0,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "HR Manager",
"set_user_permissions": 0,
"share": 0,
"submit": 1,
"write": 1
},
{
"create": 1,
"permlevel": 0,
"read": 1,
"role": "HR User",
"write": 1
}
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "job_applicant"
}

View File

@ -0,0 +1,13 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class OfferLetter(Document):
def validate(self):
self.set_applicant_name()
def set_applicant_name(self):
self.applicant_name = frappe.db.get_value("Job Applicant", self.job_applicant, "applicant_name")

View File

@ -0,0 +1,11 @@
# 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('Offer Letter')
class TestOfferLetter(unittest.TestCase):
pass