feat: Add logic to auto fetch skill from designation doc

- Set today as default evaluation date
This commit is contained in:
Suraj Shetty 2019-04-16 12:14:44 +05:30
parent 354c70a0e7
commit 006c3dccf9
3 changed files with 18 additions and 4 deletions

View File

@ -87,6 +87,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
"fetch_if_empty": 0,
"fieldname": "evaluation_date",
"fieldtype": "Date",
@ -155,7 +156,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2019-04-16 10:12:40.106070",
"modified": "2019-04-16 11:33:05.055948",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Skill",

View File

@ -5,4 +5,17 @@ frappe.ui.form.on('Employee Skill Map', {
// refresh: function(frm) {
// }
designation: (frm) => {
frm.set_value('employee_skills', null);
if (frm.doc.designation) {
frappe.db.get_doc('Designation', frm.doc.designation).then((designation) => {
designation.skills.forEach(designation_skill => {
let row = frappe.model.add_child(frm.doc, 'Employee Skill', 'employee_skills');
row.skill = designation_skill.skill;
row.proficiency = 1;
});
refresh_field('employee_skills');
});
}
}
});

View File

@ -157,7 +157,7 @@
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "employee_skill",
"fieldname": "employee_skills",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
@ -166,7 +166,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Employee Skill",
"label": "Employee Skills",
"length": 0,
"no_copy": 0,
"options": "Employee Skill",
@ -192,7 +192,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2019-04-16 10:15:18.634977",
"modified": "2019-04-16 11:19:49.189166",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Skill Map",