change project get_query to include projects with status other than Completed and Cancelled

This commit is contained in:
Anand Doshi
2012-10-29 14:26:38 +05:30
parent bdaada1080
commit 548eb7b1c3
10 changed files with 31 additions and 10 deletions

View File

@@ -168,7 +168,9 @@ cur_frm.cscript.new_contact = function(){
cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) {
var cond = '';
if(doc.customer) cond = '(`tabProject`.customer = "'+doc.customer+'" OR IFNULL(`tabProject`.customer,"")="") AND';
return repl('SELECT `tabProject`.name FROM `tabProject` WHERE `tabProject`.status = "Open" AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond});
return repl('SELECT `tabProject`.name FROM `tabProject` \
WHERE `tabProject`.status not in ("Completed", "Cancelled") \
AND %(cond)s `tabProject`.name LIKE "%s" ORDER BY `tabProject`.name ASC LIMIT 50', {cond:cond});
}
//---- get customer details ----------------------------