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:
Anand Doshi
2012-11-21 18:02:22 +05:30
parent 009d3e1952
commit 93a35cab19
26 changed files with 89 additions and 16 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -857,3 +857,5 @@ cur_frm.cscript.validate_items = function(doc) {
validated = false;
}
}
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;

View File

@@ -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;