[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 // for communication
cur_frm.email_field = "email_id"; 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 // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
cur_frm.cscript.job_applicant = function() { frappe.ui.form.on("Offer Letter", {
frappe.call({ select_terms: function(frm) {
doc: cur_frm.doc, frappe.model.get_value("Terms and Conditions", frm.doc.select_terms, "terms", function(value) {
method: "set_applicant_name", frm.set_value("terms", value.terms);
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");
}
}
});
}

View File

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

View File

@ -6,11 +6,4 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
class OfferLetter(Document): class OfferLetter(Document):
def validate(self): pass
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")