Merge branch 'master' into develop
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 95c5f8a..55a78d8 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -2,7 +2,7 @@
 from __future__ import unicode_literals
 import frappe
 
-__version__ = '8.2.3'
+__version__ = '8.2.4'
 
 
 def get_default_company(user=None):
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index a3de8da..375d85d 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -733,11 +733,10 @@
 	accounts = frappe.db.sql_list("""select
 			name from tabAccount
 		where
-			is_group=0 and
-			report_type='Balance Sheet' and
-			ifnull(warehouse, '') = '' and
-			company=%s
-		order by name asc""", company)
+			is_group=0 and report_type='Balance Sheet' and company=%s and
+			name not in(select distinct account from tabWarehouse where
+			account is not null and account != '')
+		order by name asc""", frappe.db.escape(company))
 
 	return [{"account": a, "balance": get_balance_on(a)} for a in accounts]
 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 49665bb..1a55d84 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -326,10 +326,12 @@
 		}
 	}
 
+	/*
 	var item_fields_stock = ['batch_no', 'actual_batch_qty', 'actual_qty', 'expense_account',
 		'warehouse', 'expense_account', 'quality_inspection']
 	cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
 		(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
+	*/
 
 	// India related fields
 	if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index fd4598c..c545ee1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -131,6 +131,8 @@
 		if not self.is_return:
 			self.update_billing_status_for_zero_amount_refdoc("Sales Order")
 			self.check_credit_limit()
+
+		if self.update_stock:
 			self.update_serial_no()
 
 		if not cint(self.is_pos) == 1 and not self.is_return:
@@ -793,19 +795,18 @@
 
 	def update_serial_no(self, in_cancel=False):
 		""" update Sales Invoice refrence in Serial No """
+		invoice = None if (in_cancel or self.is_return) else self.name
+		if in_cancel and self.is_return:
+			invoice = self.return_against
 
 		for item in self.items:
 			if not item.serial_no:
 				continue
 
-			serial_nos = ["'%s'"%serial_no for serial_no in item.serial_no.split("\n")]
-
-			frappe.db.sql(""" update `tabSerial No` set sales_invoice='{invoice}'
-				where name in ({serial_nos})""".format(
-					invoice='' if in_cancel else self.name,
-					serial_nos=",".join(serial_nos)
-				)
-			)
+			for serial_no in item.serial_no.split("\n"):
+				sno = frappe.get_doc('Serial No', serial_no)
+				sno.sales_invoice = invoice
+				sno.db_update()
 
 	def validate_serial_numbers(self):
 		"""
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 9f7085a..59af618 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -1423,7 +1423,7 @@
    "collapsible": 1, 
    "collapsible_depends_on": "eval:doc.serial_no || doc.batch_no", 
    "columns": 0, 
-   "depends_on": "eval: parent.update_stock", 
+   "depends_on": "", 
    "fieldname": "warehouse_and_reference", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -2165,7 +2165,7 @@
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-05-10 17:14:42.681757", 
+ "modified": "2017-07-03 19:34:14.820285", 
  "modified_by": "Administrator", 
  "module": "Accounts", 
  "name": "Sales Invoice Item", 
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 111bf88..30a24f8 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -410,3 +410,4 @@
 erpnext.patches.v8_1.delete_deprecated_reports
 erpnext.patches.v8_1.setup_gst_india #2017-06-27
 execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
+erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
\ No newline at end of file
diff --git a/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py
new file mode 100644
index 0000000..2feb483
--- /dev/null
+++ b/erpnext/patches/v8_1/removed_roles_from_gst_report_non_indian_account.py
@@ -0,0 +1,18 @@
+# Copyright (c) 2017, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+	frappe.reload_doc('core', 'doctype', 'has_role')
+	company = frappe.get_all('Company', filters = {'country': 'India'})
+
+	if not company:
+		frappe.db.sql("""
+			delete from
+				`tabHas Role`
+			where
+				parenttype = 'Report' and parent in('GST Sales Register',
+					'GST Purchase Register', 'GST Itemised Sales Register',
+					'GST Itemised Purchase Register')""")
\ No newline at end of file
diff --git a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json
index 6f122135..23cf082 100644
--- a/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json
+++ b/erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json
@@ -84,7 +84,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-29 21:28:09.053351", 
+ "modified": "2017-06-30 20:12:57.903983", 
  "modified_by": "Administrator", 
  "module": "Regional", 
  "name": "GST HSN Code", 
@@ -94,10 +94,11 @@
  "quick_entry": 1, 
  "read_only": 0, 
  "read_only_onload": 0, 
- "search_fields": "description", 
+ "search_fields": "hsn_code, description", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
+ "title_field": "hsn_code", 
  "track_changes": 1, 
  "track_seen": 0
 }
\ No newline at end of file