Merge pull request #2474 from nabinhait/fix1
Added leave approver name field in leave application
This commit is contained in:
commit
e83d506319
@ -118,3 +118,18 @@ cur_frm.cscript.calculate_total_days = function(doc, dt, dn) {
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.employee.get_query = erpnext.queries.employee;
|
||||
|
||||
frappe.ui.form.on("Leave Application", "leave_approver", function(frm) {
|
||||
frappe.call({
|
||||
"method": "frappe.client.get",
|
||||
args: {
|
||||
doctype: "User",
|
||||
name: frm.doc.leave_approver
|
||||
},
|
||||
callback: function (data) {
|
||||
frappe.model.set_value(frm.doctype, frm.docname, "leave_approver_name",
|
||||
data.message.first_name
|
||||
+ (data.message.last_name ? (" " + data.message.last_name) : ""))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -24,6 +24,13 @@
|
||||
"options": "User",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "leave_approver_name",
|
||||
"fieldtype": "Read Only",
|
||||
"label": "Leave Approver Name",
|
||||
"permlevel": 0,
|
||||
"precision": ""
|
||||
},
|
||||
{
|
||||
"fieldname": "leave_type",
|
||||
"fieldtype": "Link",
|
||||
@ -184,7 +191,7 @@
|
||||
"idx": 1,
|
||||
"is_submittable": 1,
|
||||
"max_attachments": 3,
|
||||
"modified": "2014-09-09 05:35:31.531651",
|
||||
"modified": "2014-12-09 16:33:29.626849",
|
||||
"modified_by": "Administrator",
|
||||
"module": "HR",
|
||||
"name": "Leave Application",
|
||||
|
Loading…
Reference in New Issue
Block a user