mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 13:38:27 +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:
@@ -27,6 +27,8 @@ cur_frm.cscript.project = function(doc, cdt, cdn){
|
||||
if(doc.project) get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
||||
}
|
||||
|
||||
|
||||
// TODO: remove these? field doesn't exist, but custom field could exist
|
||||
cur_frm.fields_dict['customer'].get_query = function(doc,cdt,cdn){
|
||||
var cond='';
|
||||
if(doc.project) cond = 'ifnull(`tabProject`.customer, "") = `tabCustomer`.name AND ifnull(`tabProject`.name, "") = "'+doc.project+'" AND';
|
||||
|
||||
@@ -41,7 +41,8 @@ class DocType:
|
||||
if cust:
|
||||
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
||||
return ret
|
||||
|
||||
|
||||
# TODO: Remove these? as the field customer doesn't exists
|
||||
def get_customer_details(self):
|
||||
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
||||
if cust:
|
||||
|
||||
Reference in New Issue
Block a user