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

@@ -1,3 +1,13 @@
cur_frm.cscript.onload = function(doc) {
cur_frm.fields_dict.user.get_query = function() {
return "select name, concat_ws(' ', first_name, middle_name, last_name) \
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
(%(key)s like \"%s\" or \
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
limit 50";
};
}
cur_frm.cscript.refresh = function(doc, dt, dn) {
if(!doc.__islocal) {
var field_list = ['lead', 'customer', 'supplier', 'contact', 'opportunity',

View File

@@ -188,3 +188,5 @@ EmailMessage = function(parent, args, list, idx) {
}
this.make();
}
cur_frm.fields_dict.allocated_to.get_query = erpnext.profile_query;