Merge pull request #36983 from deepeshgarg007/employee_utils

chore: Update employee for tests
This commit is contained in:
Deepesh Garg 2023-09-06 16:31:29 +05:30 committed by GitHub
commit c2f8f1d028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,5 +66,8 @@ def make_employee(user, company=None, **kwargs):
employee.insert()
return employee.name
else:
frappe.db.set_value("Employee", {"employee_name": user}, "status", "Active")
return frappe.get_value("Employee", {"employee_name": user}, "name")
employee = frappe.get_doc("Employee", {"employee_name": user})
employee.update(kwargs)
employee.status = "Active"
employee.save()
return employee.name