From c4d38c0afc83c99fbabbbd4fc9a08e62d4851e96 Mon Sep 17 00:00:00 2001 From: Navdeep Ghai <30634335+navdeepghai1@users.noreply.github.com> Date: Mon, 24 Dec 2018 13:23:19 +0400 Subject: [PATCH] Fix the disappears of image bug after uploading and saving the employee (#16217) * Fix image disappears of image after uploading and saving the employee * Fix the codacy issue --- erpnext/hr/doctype/employee/employee.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 81671c21dc..5d5bdd99ce 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -55,8 +55,8 @@ class Employee(NestedSet): def validate_user_details(self): data = frappe.db.get_value('User', self.user_id, ['enabled', 'user_image'], as_dict=1) - - self.image = data.get("user_image") + if data.get("user_image"): + self.image = data.get("user_image") self.validate_for_enabled_user_id(data.get("enabled", 0)) self.validate_duplicate_user_id() @@ -336,4 +336,4 @@ def get_children(doctype, parent=None, company=None, is_root=False, is_tree=Fals .format(company=company, condition=condition), as_dict=1) # return employee - return employee \ No newline at end of file + return employee