[fix] [minor] batch no get query
diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py
index 3c43c1e..baa8850 100644
--- a/selling/doctype/sales_common/sales_common.py
+++ b/selling/doctype/sales_common/sales_common.py
@@ -340,7 +340,7 @@
 					and batch_no like '%(txt)s' 
 					and exists(select * from `tabBatch` 
 							where name = sle.batch_no 
-								and expiry_date >= '%(posting_date)s' 
+								and (ifnull(expiry_date, '')='' or expiry_date >= '%(posting_date)s') 
 								and docstatus != 2) 
 					%(mcond)s
 				group by batch_no having sum(actual_qty) > 0 
@@ -353,11 +353,11 @@
 		return webnotes.conn.sql("""select name from tabBatch 
 				where docstatus != 2 
 					and item = '%(item_code)s' 
-					and expiry_date >= '%(posting_date)s' 
+					and (ifnull(expiry_date, '')='' or expiry_date >= '%(posting_date)s')
 					and name like '%(txt)s' 
 					%(mcond)s 
 				order by name desc 
 				limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'], 
 				'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt, 
 				'mcond':get_match_cond(doctype, searchfield),'start': start, 
-				'page_len': page_len})
\ No newline at end of file
+				'page_len': page_len})