fix(HR): Ignore invalid fields when updating employee details (#27456)
This commit is contained in:
parent
1c1b476d67
commit
95460d9818
@ -32,7 +32,10 @@ def set_employee_name(doc):
|
|||||||
def update_employee(employee, details, date=None, cancel=False):
|
def update_employee(employee, details, date=None, cancel=False):
|
||||||
internal_work_history = {}
|
internal_work_history = {}
|
||||||
for item in details:
|
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
|
new_data = item.new if not cancel else item.current
|
||||||
if fieldtype == "Date" and new_data:
|
if fieldtype == "Date" and new_data:
|
||||||
new_data = getdate(new_data)
|
new_data = getdate(new_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user