changed from label based to fieldname based

This commit is contained in:
robert schouten 2016-09-22 08:32:54 +08:00
parent d7721a605d
commit 147c727743

View File

@ -57,11 +57,7 @@ frappe.ui.form.on('Employee',{
frm.events.update_contact(frm)
},
update_contact:function(frm){
for(var i =0, j=frm.fields.length;i<j;i++){
if (frm.fields[i].df.label===frm.doc.prefered_contact_email){
frm.set_value("prefered_email",frm.fields[i].value)
}
}
frm.set_value("prefered_email",frm.fields_dict[frappe.model.scrub(frm.doc.prefered_contact_email)].value)
}
});
cur_frm.cscript = new erpnext.hr.EmployeeController({frm: cur_frm});