Skip to content

Commit

Permalink
fix(HR): Ignore invalid fields when updating employee details (frappe…
Browse files Browse the repository at this point in the history
…#27456) (frappe#27474)

(cherry picked from commit 95460d9)

Co-authored-by: Chillar Anand <chillar@avilpage.com>
  • Loading branch information
frappe-pr-bot and ChillarAnand authored Sep 14, 2021
1 parent 8fd1aec commit c9e7e72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/hr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,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)
Expand Down

0 comments on commit c9e7e72

Please sign in to comment.