mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 03:29:16 +00:00
added customer get_query to allow search based on customer name. also don't show name again if id naming is based on customer name and not series
This commit is contained in:
@@ -83,3 +83,4 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE customer = "'+ doc.customer +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
@@ -148,4 +148,6 @@ cur_frm.cscript['Create Opportunity'] = function(){
|
||||
//get query select Territory
|
||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
@@ -210,4 +210,6 @@ cur_frm.cscript['Declare Opportunity Lost'] = function(){
|
||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';}
|
||||
|
||||
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
||||
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
@@ -857,3 +857,5 @@ cur_frm.cscript.validate_items = function(doc) {
|
||||
validated = false;
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
@@ -18,3 +18,5 @@
|
||||
// =====================================================================
|
||||
cur_frm.add_fetch('customer','customer_name','customer_name');
|
||||
cur_frm.add_fetch('customer','address','customer_address');
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
Reference in New Issue
Block a user