fix: log type mandatory error while exposing api call to employee checkin

This commit is contained in:
Kaviya Periyasamy
2020-07-08 11:15:04 +05:30
parent addd1e842b
commit 923ed8a741
2 changed files with 6 additions and 3 deletions

View File

@@ -6,5 +6,9 @@ frappe.ui.form.on('Employee Checkin', {
if(!frm.doc.time) { if(!frm.doc.time) {
frm.set_value("time", frappe.datetime.now_datetime()); frm.set_value("time", frappe.datetime.now_datetime());
} }
},
refresh: (frm) => {
// make log type mandatory
frm.set_df_property('log_type', 'reqd', frm.doc.log_type ? 0 : 1);
} }
}); });

View File

@@ -41,8 +41,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Log Type", "label": "Log Type",
"options": "\nIN\nOUT", "options": "\nIN\nOUT"
"reqd": 1
}, },
{ {
"fieldname": "shift", "fieldname": "shift",
@@ -108,7 +107,7 @@
} }
], ],
"links": [], "links": [],
"modified": "2020-01-23 04:57:42.551355", "modified": "2020-07-08 11:02:32.660986",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Checkin", "name": "Employee Checkin",