Merge pull request #2866 from neilLasrado/barcode

Barcode added to stock entry
diff --git a/README.md b/README.md
index f2b628e..ac03c50 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 
 ERPNext is built on the [Frappe](https://github.com/frappe/frappe) Framework, a full-stack web app framework in Python & Javascript.
 
-- [User Guide](https://erpnext.com/user-guide)
+- [User Guide](https://manual.erpnext.com)
 - [Getting Help](http://erpnext.org/getting-help.html)
 - [Discussion Forum](https://discuss.frappe.io/)
 
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 3b901c4..6757e43 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -55,6 +55,7 @@
 
 		if cint(self.update_stock):
 			self.validate_item_code()
+			self.validate_warehouse()
 			self.update_current_stock()
 			self.validate_delivery_note()
 
@@ -335,6 +336,11 @@
 			if not d.item_code:
 				msgprint(_("Item Code required at Row No {0}").format(d.idx), raise_exception=True)
 
+	def validate_warehouse(self):
+		for d in self.get('entries'):
+			if not d.warehouse:
+				frappe.throw(_("Warehouse required at Row No {0}").format(d.idx))
+
 	def validate_delivery_note(self):
 		for d in self.get("items"):
 			if d.delivery_note:
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 9978bb4..4ae61ca 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -161,7 +161,8 @@
 def get_accounts(company, root_type):
 	# root lft, rgt
 	root_account = frappe.db.sql("""select lft, rgt from `tabAccount`
-		where company=%s and root_type=%s order by lft limit 1""",
+		where company=%s and root_type=%s and ifnull(parent_account, '') = ''
+		order by lft limit 1""",
 		(company, root_type), as_dict=True)
 
 	if not root_account:
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index f441e9b..0c8f047 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -90,6 +90,8 @@
    "permlevel": 0
   }, 
   {
+   "depends_on": "eval:!doc.__islocal", 
+   "description": "Mention if non-standard receivable account applicable", 
    "fieldname": "accounts", 
    "fieldtype": "Table", 
    "label": "Accounts", 
@@ -170,7 +172,7 @@
  ], 
  "icon": "icon-user", 
  "idx": 1, 
- "modified": "2015-02-20 05:07:32.060901", 
+ "modified": "2015-02-24 17:35:03.821318", 
  "modified_by": "Administrator", 
  "module": "Buying", 
  "name": "Supplier", 
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index f7a50c5..831e07e 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -281,18 +281,6 @@
 				},
 				{
 					"type": "report",
-					"name": "Customer Account Head",
-					"is_query_report": True,
-					"doctype": "Account"
-				},
-				{
-					"type": "report",
-					"name": "Supplier Account Head",
-					"is_query_report": True,
-					"doctype": "Account"
-				},
-				{
-					"type": "report",
 					"name": "Item-wise Sales Register",
 					"is_query_report": True,
 					"doctype": "Sales Invoice"
diff --git a/erpnext/patches/v5_0/update_projects.py b/erpnext/patches/v5_0/update_projects.py
index 29300e5..f49bc66 100644
--- a/erpnext/patches/v5_0/update_projects.py
+++ b/erpnext/patches/v5_0/update_projects.py
@@ -5,7 +5,8 @@
 	frappe.reload_doctype("Project")
 
 	for m in frappe.get_all("Project Milestone", "*"):
-		if m.milestone and m.milestone_date:
+		if (m.milestone and m.milestone_date
+			and frappe.db.exists("Project", m.parent)):
 			frappe.get_doc({
 				"doctype": "Task",
 				"subject": m.milestone,
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index b76cfae..19f68b5 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -9,7 +9,7 @@
 
 	$('.navbar-home').html('ERPNext');
 
-	$('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide")
+	$('[data-link="docs"]').attr("href", "https://manual.erpnext.com")
 });
 
 // doctypes created via tree
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index dcfbf1e..36092c0 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -137,7 +137,8 @@
    "permlevel": 0
   }, 
   {
-   "description": "", 
+   "depends_on": "eval:!doc.__islocal", 
+   "description": "Mention if non-standard receivable account applicable", 
    "fieldname": "accounts", 
    "fieldtype": "Table", 
    "label": "Accounts", 
@@ -268,7 +269,7 @@
  ], 
  "icon": "icon-user", 
  "idx": 1, 
- "modified": "2015-02-20 01:39:41.062529", 
+ "modified": "2015-02-24 17:32:36.065246", 
  "modified_by": "Administrator", 
  "module": "Selling", 
  "name": "Customer", 
diff --git a/erpnext/setup/doctype/customer_group/customer_group.json b/erpnext/setup/doctype/customer_group/customer_group.json
index a08564d..c6ea98c 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.json
+++ b/erpnext/setup/doctype/customer_group/customer_group.json
@@ -116,6 +116,8 @@
    "permlevel": 0
   }, 
   {
+   "depends_on": "eval:!doc.__islocal", 
+   "description": "Mention if non-standard receivable account applicable", 
    "fieldname": "accounts", 
    "fieldtype": "Table", 
    "label": "Accounts", 
@@ -126,7 +128,7 @@
  "icon": "icon-sitemap", 
  "idx": 1, 
  "in_create": 0, 
- "modified": "2015-02-05 05:11:36.752161", 
+ "modified": "2015-02-24 17:34:40.749511", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Customer Group", 
diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.json b/erpnext/setup/doctype/supplier_type/supplier_type.json
index d6a2809..db1bcf2 100644
--- a/erpnext/setup/doctype/supplier_type/supplier_type.json
+++ b/erpnext/setup/doctype/supplier_type/supplier_type.json
@@ -30,6 +30,8 @@
    "permlevel": 0
   }, 
   {
+   "depends_on": "eval:!doc.__islocal", 
+   "description": "Mention if non-standard receivable account applicable", 
    "fieldname": "accounts", 
    "fieldtype": "Table", 
    "label": "Accounts", 
@@ -39,7 +41,7 @@
  ], 
  "icon": "icon-flag", 
  "idx": 1, 
- "modified": "2015-02-05 05:11:47.821736", 
+ "modified": "2015-02-24 17:35:22.087557", 
  "modified_by": "Administrator", 
  "module": "Setup", 
  "name": "Supplier Type", 
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 4d03106..96862a0 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -179,7 +179,8 @@
 	# if default specified in item is for another company, fetch from company
 	for d in [["Account", "income_account", "default_income_account"], ["Account", "expense_account", "default_expense_account"],
 		["Cost Center", "cost_center", "cost_center"], ["Warehouse", "warehouse", ""]]:
-			if not out[d[1]] or args.company != frappe.db.get_value(d[0], out.get(d[1]), "company"):
+			company = frappe.db.get_value(d[0], out.get(d[1]), "company")
+			if not out[d[1]] or (company and args.company != company):
 				out[d[1]] = frappe.db.get_value("Company", args.company, d[2]) if d[2] else None
 
 	for fieldname in ("item_name", "item_group", "barcode", "brand", "stock_uom"):
diff --git a/erpnext/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html
index 2a35fb8..854f77f 100644
--- a/erpnext/templates/includes/product_in_grid.html
+++ b/erpnext/templates/includes/product_in_grid.html
@@ -3,6 +3,6 @@
 <a class="product-link" href="{{ route or page_name }}">
 	<div class="col-sm-2 col-xs-4 product-image-wrapper">
 		{{ product_image_square(website_image) }}
-		<div class="text-ellipsis small product-text">{{ item_name }}</div>
+		<div class="text-ellipsis inline-block small product-text">{{ item_name }}</div>
 	</div>
 </a>