get_query for profile based link fields to enable searching by name

This commit is contained in:
Anand Doshi
2012-11-19 15:43:18 +05:30
parent f26511e466
commit e65e621145
11 changed files with 65 additions and 17 deletions

View File

@@ -85,12 +85,9 @@ cur_frm.cscript.transaction = function(doc,cdt,cdn){
}
// System User Trigger
// -------------------
cur_frm.fields_dict['system_user'].get_query = function(doc) {
return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.enabled = 1 AND tabProfile.%(key)s LIKE "%s" LIMIT 50'
}
cur_frm.fields_dict.system_user.get_query = erpnext.profile_query;
cur_frm.fields_dict.approving_user.get_query = erpnext.profile_query;
// System Role Trigger
// -----------------------
@@ -98,14 +95,6 @@ cur_frm.fields_dict['system_role'].get_query = function(doc) {
return 'SELECT tabRole.name FROM tabRole WHERE tabRole.name not in ("Administrator","Guest","All") AND tabRole.%(key)s LIKE "%s" LIMIT 50'
}
// Approving User Trigger
// -----------------------
cur_frm.fields_dict['approving_user'].get_query = function(doc) {
return 'SELECT tabProfile.name FROM tabProfile WHERE tabProfile.name not in ("Administrator","Guest") AND tabProfile.docstatus != 2 AND tabProfile.enabled = 1 AND tabProfile.%(key)s LIKE "%s" LIMIT 50'
}
// Approving Role Trigger
// -----------------------
cur_frm.fields_dict['approving_role'].get_query = function(doc) {