Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 3593fa0..b75538d 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -111,6 +111,7 @@
 		+'AND ifnull(`tabBin`.`actual_qty`,0) > 0 '
 		+'AND tabBin.warehouse="'+ d.s_warehouse +'" '
 		+'AND tabItem.docstatus < 2 '
+		+'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")'
 		+'AND tabItem.%(key)s LIKE "%s" '
 		+'ORDER BY tabItem.name ASC '
 		+'LIMIT 50'
@@ -118,6 +119,7 @@
 		return 'SELECT tabItem.name, tabItem.description '
 		+'FROM tabItem '
 		+'WHERE tabItem.docstatus < 2 '
+		+'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")'
 		+'AND tabItem.%(key)s LIKE "%s" '
 		+'ORDER BY tabItem.name ASC '
 		+'LIMIT 50'
diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js
index dfaa7cd..0f1aa5c 100644
--- a/erpnext/utilities/page/todo/todo.js
+++ b/erpnext/utilities/page/todo/todo.js
@@ -45,10 +45,10 @@
 			'Low':''
 		}
 		todo.labelclass = label_map[todo.priority];
-		todo.userdate = dateutil.str_to_user(todo.date);
+		todo.userdate = dateutil.str_to_user(todo.date) || '';
 		if(todo.reference_name && todo.reference_type) {
 			todo.link = repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">\
-						%(reference_name)s</a>', todo);
+						%(reference_type)s: %(reference_name)s</a>', todo);
 		} else if(todo.reference_type) {
 			todo.link = repl('<a href="#!List/%(reference_type)s">\
 						%(reference_type)s</a>', todo);
@@ -60,7 +60,7 @@
 					<span class="label %(labelclass)s">%(priority)s</span>\
 					<span class="help" style="margin-right: 7px">%(userdate)s</span>\
 					%(description)s</span>\
-					<span class="ref_link">&rarr;\
+					<span class="ref_link">&rarr; &nbsp;\
 					%(link)s</span>\
 					<a href="#" class="close">&times;</a>\
 		</div>', todo));