diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index bc63ba79a80..3408c8f1843 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -456,7 +456,7 @@ const set_employee_and_company = function (frm) { const options = { user_id: frappe.session.user }; const fields = ["name", "company"]; frappe.db.get_value("Employee", options, fields).then(({ message }) => { - if (message) { + if (message.name && message.company) { // there is an employee with the currently logged in user_id frm.set_value("employee", message.name); frm.set_value("company", message.company);