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
This commit is contained in:
parent
91ddadeefa
commit
c4d38c0afc
@ -55,8 +55,8 @@ class Employee(NestedSet):
|
|||||||
def validate_user_details(self):
|
def validate_user_details(self):
|
||||||
data = frappe.db.get_value('User',
|
data = frappe.db.get_value('User',
|
||||||
self.user_id, ['enabled', 'user_image'], as_dict=1)
|
self.user_id, ['enabled', 'user_image'], as_dict=1)
|
||||||
|
if data.get("user_image"):
|
||||||
self.image = data.get("user_image")
|
self.image = data.get("user_image")
|
||||||
self.validate_for_enabled_user_id(data.get("enabled", 0))
|
self.validate_for_enabled_user_id(data.get("enabled", 0))
|
||||||
self.validate_duplicate_user_id()
|
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)
|
.format(company=company, condition=condition), as_dict=1)
|
||||||
|
|
||||||
# return employee
|
# return employee
|
||||||
return employee
|
return employee
|
||||||
|
Loading…
x
Reference in New Issue
Block a user