From 95460d98186ea62873487faf3c04af19f1d2fb11 Mon Sep 17 00:00:00 2001 From: Chillar Anand Date: Tue, 14 Sep 2021 12:00:34 +0530 Subject: [PATCH] fix(HR): Ignore invalid fields when updating employee details (#27456) --- erpnext/hr/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/utils.py b/erpnext/hr/utils.py index deec644209..b6f4cadcc9 100644 --- a/erpnext/hr/utils.py +++ b/erpnext/hr/utils.py @@ -32,7 +32,10 @@ def set_employee_name(doc): def update_employee(employee, details, date=None, cancel=False): internal_work_history = {} for item in details: - fieldtype = frappe.get_meta("Employee").get_field(item.fieldname).fieldtype + field = frappe.get_meta("Employee").get_field(item.fieldname) + if not field: + continue + fieldtype = field.fieldtype new_data = item.new if not cancel else item.current if fieldtype == "Date" and new_data: new_data = getdate(new_data)