Merge pull request #23605 from marination/item-link-formatter

fix: Item Link Formatter Behaviour
This commit is contained in:
Deepesh Garg 2020-10-13 21:26:00 +05:30 committed by GitHub
commit 71a58a8fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -703,9 +703,13 @@ erpnext.utils.map_current_doc = function(opts) {
}
frappe.form.link_formatters['Item'] = function(value, doc) {
if(doc && doc.item_name && doc.item_name !== value) {
return value? value + ': ' + doc.item_name: doc.item_name;
if (doc && value && doc.item_name && doc.item_name !== value) {
return value + ': ' + doc.item_name;
} else if (!value && doc.doctype && doc.item_name) {
// format blank value in child table
return doc.item_name;
} else {
// if value is blank in report view or item code and name are the same, return as is
return value;
}
}