Merge pull request #2855 from pratu16x7/search-fixes

Revert to search table name field
This commit is contained in:
Nabin Hait 2017-03-13 13:13:34 +05:30 committed by GitHub
commit 9414bec421

View file

@ -364,7 +364,7 @@ frappe.search.GlobalSearch = Class.extend({
},
format_result: function(result) {
var name, route = '#Form/' + result.doctype + '/' + result.title;
var name, route = '#Form/' + result.doctype + '/' + result.name;
var description = this.get_finds(result.content, this.keywords);
if(result.doctype === "Communication") {
if(description.indexOf(',') === -1) {
@ -373,7 +373,7 @@ frappe.search.GlobalSearch = Class.extend({
name = description.slice(description.indexOf(':') + 8, description.indexOf(','));
}
} else {
name = result.title;
name = result.name;
}
return [route, this.bold_keywords(name), description];
},
@ -544,9 +544,9 @@ frappe.search.GlobalSearch = Class.extend({
var make_option = function(data) {
return {
label: __("{0}: {1}", [__(data.doctype).bold(), data.title]),
value: __("{0}: {1}", [__(data.doctype), data.title]),
route: ["Form", data.doctype, data.title],
label: __("{0}: {1}", [__(data.doctype).bold(), data.name]),
value: __("{0}: {1}", [__(data.doctype), data.name]),
route: ["Form", data.doctype, data.name],
match: data.doctype,
index: 60,
default: "Global",