mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
get_query for profile based link fields to enable searching by name
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -188,3 +188,5 @@ EmailMessage = function(parent, args, list, idx) {
|
||||
}
|
||||
this.make();
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.allocated_to.get_query = erpnext.profile_query;
|
||||
Reference in New Issue
Block a user