[minor] [fix] opportunity form, queries, stock uom replace utility

This commit is contained in:
Anand Doshi
2013-07-18 13:26:27 +05:30
parent 4daf3dd8a8
commit 61cad5076b
7 changed files with 133 additions and 282 deletions

View File

@@ -2,11 +2,11 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name');
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
cur_frm.fields_dict.customer.get_query = erpnext.queries.customer;
cur_frm.fields_dict.supplier.get_query = erpnext.queries.supplier;
if(cur_frm.fields_dict.lead) {
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
cur_frm.fields_dict.lead.get_query = erpnext.queries.lead;
cur_frm.add_fetch('lead', 'lead_name', 'lead_name');
}

View File

@@ -145,20 +145,6 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start,
'page_len': page_len})
def item_std(doctype, txt, searchfield, start, page_len, filters):
return webnotes.conn.sql("""select tabItem.name,
if(length(tabItem.item_name) > 40,
concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name,
if(length(tabItem.description) > 40,
concat(substr(tabItem.description, 1, 40), "..."), description) as decription
FROM tabItem
WHERE tabItem.docstatus!=2
and tabItem.%(key)s LIKE "%(txt)s"
%(mcond)s
limit %(start)s, %(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt,
'mcond':get_match_cond(doctype, searchfield), 'start': start,
'page_len': page_len})
def account_query(doctype, txt, searchfield, start, page_len, filters):
conditions = []
if not filters: