[fixes] offer letter

This commit is contained in:
Rushabh Mehta 2015-03-05 11:30:55 +05:30 committed by Neil Trini Lasrado
parent 8ca547b7f2
commit aca5cb6513
4 changed files with 28 additions and 59 deletions

View File

@ -5,7 +5,3 @@
// for communication
cur_frm.email_field = "email_id";
cur_frm.cscript = {
refresh: function(doc) {
},
}

View File

@ -1,26 +1,10 @@
// 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");
}
}
});
}
cur_frm.cscript.terms = function() {
frappe.call({
doc: cur_frm.doc,
method: "set_view_terms",
callback: function(r) {
if(!r.exe){
refresh_field("view_terms");
}
}
});
}
frappe.ui.form.on("Offer Letter", {
select_terms: function(frm) {
frappe.model.get_value("Terms and Conditions", frm.doc.select_terms, "terms", function(value) {
frm.set_value("terms", value.terms);
});
}
});

View File

@ -1,8 +1,8 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_import": 1,
"allow_rename": 0,
"autoname": "OL-.######",
"autoname": "Offer-.#####",
"creation": "2015-03-04 14:20:17.662207",
"custom": 0,
"docstatus": 0,
@ -22,7 +22,7 @@
"options": "Job Applicant",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
@ -33,6 +33,7 @@
"fieldname": "applicant_name",
"fieldtype": "Data",
"label": "Applicant Name",
"options": "job_applicant.applicant_name",
"permlevel": 0,
"precision": "",
"read_only": 1
@ -49,7 +50,8 @@
"label": "Status",
"options": "Awaiting Response\nAccepted\nRejected ",
"permlevel": 0,
"precision": ""
"precision": "",
"print_hide": 1
},
{
"allow_on_submit": 0,
@ -159,7 +161,8 @@
"label": "Company",
"options": "Company",
"permlevel": 0,
"precision": ""
"precision": "",
"print_hide": 1
},
{
"fieldname": "section_break_14",
@ -169,18 +172,18 @@
},
{
"allow_on_submit": 0,
"fieldname": "terms",
"fieldname": "select_terms",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Terms",
"label": "Select Terms",
"no_copy": 0,
"options": "Terms and Conditions",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide": 1,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
@ -188,10 +191,10 @@
"set_only_once": 0
},
{
"fieldname": "view_terms",
"fieldname": "terms",
"fieldtype": "Text Editor",
"label": "View Terms",
"options": "view_terms",
"label": "Terms",
"options": "",
"permlevel": 0,
"precision": ""
},
@ -213,7 +216,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
"modified": "2015-03-04 16:30:16.012258",
"modified": "2015-03-05 00:54:34.719300",
"modified_by": "Administrator",
"module": "HR",
"name": "Offer Letter",
@ -227,24 +230,17 @@
"create": 1,
"delete": 1,
"email": 0,
"export": 0,
"import": 0,
"export": 1,
"import": 1,
"permlevel": 0,
"print": 0,
"print": 1,
"read": 1,
"report": 0,
"role": "HR Manager",
"report": 1,
"role": "HR User",
"set_user_permissions": 0,
"share": 0,
"submit": 1,
"write": 1
},
{
"create": 1,
"permlevel": 0,
"read": 1,
"role": "HR User",
"write": 1
}
],
"read_only": 0,

View File

@ -6,11 +6,4 @@ 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")
def set_view_terms(self):
self.view_terms = frappe.db.get_value("Terms and Conditions", self.terms, "terms")
pass