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

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

View File

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