Merge pull request #3195 from nabinhait/v4.x.x

fixes
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.py b/erpnext/accounts/page/accounts_browser/accounts_browser.py
index 2318588..f7b30a9 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.py
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.py
@@ -21,12 +21,13 @@
 	
 	# root
 	if args['parent'] in ("Accounts", "Cost Centers"):
+		select_cond = ", root_type, report_type" if args["parent"]=="Accounts" else ""
 		acc = frappe.db.sql(""" select 
-			name as value, if(group_or_ledger='Group', 1, 0) as expandable, root_type, report_type
+			name as value, if(group_or_ledger='Group', 1, 0) as expandable %s
 			from `tab%s`
 			where ifnull(parent_%s,'') = ''
 			and `company` = %s	and docstatus<2 
-			order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'),
+			order by name""" % (select_cond, ctype, ctype.lower().replace(' ','_'), '%s'),
 				company, as_dict=1)
 				
 		if args["parent"]=="Accounts":
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index 25f429a..173f7c7 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -97,8 +97,8 @@
 					frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
 
 			items.append(cstr(d.item_code))
-			if items and len(items) != len(set(items)):
-				frappe.msgprint(_("Warning: Same item has been entered multiple times."))
+		if items and len(items) != len(set(items)):
+			frappe.msgprint(_("Warning: Same item has been entered multiple times."))
 			
 
 	def check_for_stopped_status(self, doctype, docname):