fix: Employee link formatter showing incorrect value for Employee Name (#28504)
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 0323a42..f0facdd 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -751,9 +751,13 @@
}
frappe.form.link_formatters['Employee'] = function(value, doc) {
- if(doc && doc.employee_name && doc.employee_name !== value) {
- return value? value + ': ' + doc.employee_name: doc.employee_name;
+ if (doc && value && doc.employee_name && doc.employee_name !== value && doc.employee === value) {
+ return value + ': ' + doc.employee_name;
+ } else if (!value && doc.doctype && doc.employee_name) {
+ // format blank value in child table
+ return doc.employee;
} else {
+ // if value is blank in report view or project name and name are the same, return as is
return value;
}
}