Merge branch '1310' of github.com:webnotes/erpnext
This commit is contained in:
commit
1788c8b4d0
@ -117,6 +117,8 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
filters.get("company"), "%%%s%%" % txt, start, page_len]))
|
filters.get("company"), "%%%s%%" % txt, start, page_len]))
|
||||||
|
|
||||||
def item_query(doctype, txt, searchfield, start, page_len, filters):
|
def item_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
from webnotes.utils import nowdate
|
||||||
|
|
||||||
conditions = []
|
conditions = []
|
||||||
|
|
||||||
return webnotes.conn.sql("""select tabItem.name,
|
return webnotes.conn.sql("""select tabItem.name,
|
||||||
@ -125,13 +127,20 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
if(length(tabItem.description) > 40, \
|
if(length(tabItem.description) > 40, \
|
||||||
concat(substr(tabItem.description, 1, 40), "..."), description) as decription
|
concat(substr(tabItem.description, 1, 40), "..."), description) as decription
|
||||||
from tabItem
|
from tabItem
|
||||||
where tabItem.docstatus<2
|
where tabItem.docstatus < 2
|
||||||
and (tabItem.%(key)s LIKE "%(txt)s"
|
and (ifnull(tabItem.end_of_life, '') = '' or tabItem.end_of_life > %(today)s)
|
||||||
or tabItem.item_name LIKE "%(txt)s")
|
and (tabItem.`{key}` LIKE %(txt)s
|
||||||
%(fcond)s %(mcond)s
|
or tabItem.item_name LIKE %(txt)s)
|
||||||
limit %(start)s,%(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt,
|
{fcond} {mcond}
|
||||||
'fcond': get_filters_cond(doctype, filters, conditions),
|
limit %(start)s, %(page_len)s """.format(key=searchfield,
|
||||||
'mcond': get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
|
fcond=get_filters_cond(doctype, filters, conditions),
|
||||||
|
mcond=get_match_cond(doctype, searchfield)),
|
||||||
|
{
|
||||||
|
"today": nowdate(),
|
||||||
|
"txt": "%%%s%%" % txt,
|
||||||
|
"start": start,
|
||||||
|
"page_len": page_len
|
||||||
|
})
|
||||||
|
|
||||||
def bom(doctype, txt, searchfield, start, page_len, filters):
|
def bom(doctype, txt, searchfield, start, page_len, filters):
|
||||||
conditions = []
|
conditions = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user