Merge pull request #3339 from rmehta/help

[help] added links in modules, added learn desktop module
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 49b5c25..cb36d05 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -55,7 +55,7 @@
 		.change(function() {
 			var ctype = frappe.get_route()[1] || 'Account';
 			erpnext.account_chart = new erpnext.AccountsChart(ctype, $(this).val(),
-				chart_area.get(0));
+				chart_area.get(0), wrapper.page);
 		})
 
 	// load up companies
@@ -75,19 +75,23 @@
 	// set route
 	var ctype = frappe.get_route()[1] || 'Account';
 
+
+
 	if(erpnext.account_chart && erpnext.account_chart.ctype != ctype) {
 		wrapper.$company_select.change();
 	}
 }
 
 erpnext.AccountsChart = Class.extend({
-	init: function(ctype, company, wrapper) {
+	init: function(ctype, company, wrapper, page) {
 		$(wrapper).empty();
 		var me = this;
 		me.ctype = ctype;
 		me.can_create = frappe.model.can_create(this.ctype);
 		me.can_delete = frappe.model.can_delete(this.ctype);
 		me.can_write = frappe.model.can_write(this.ctype);
+		me.page = page;
+		me.set_title();
 
 		// __("Accounts"), __("Cost Centers")
 
@@ -169,9 +173,9 @@
 	set_title: function(val) {
 		var chart_str = this.ctype=="Account" ? __("Chart of Accounts") : __("Chart of Cost Centers");
 		if(val) {
-			wrapper.page.set_title(chart_str + " - " + cstr(val));
+			this.page.set_title(chart_str + " - " + cstr(val));
 		} else {
-			wrapper.page.set_title(chart_str);
+			this.page.set_title(chart_str);
 		}
 	},
 
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index a5a4024..64508b8 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -329,4 +329,25 @@
 				},
 			]
 		},
+		{
+			"label": _("Help"),
+			"icon": "icon-facetime-video",
+			"items": [
+				{
+					"type": "help",
+					"label": _("Chart of Accounts"),
+					"youtube_id": "DyR-DST-PyA"
+				},
+				{
+					"type": "help",
+					"label": _("Opening Accounting Balance"),
+					"youtube_id": "kdgM20Q-q68"
+				},
+				{
+					"type": "help",
+					"label": _("Setting up Taxes"),
+					"youtube_id": "nQ1zZdPgdaQ"
+				}
+			]
+		}
 	]
diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py
index 17418c3..7729872 100644
--- a/erpnext/config/buying.py
+++ b/erpnext/config/buying.py
@@ -156,4 +156,14 @@
 				}
 			]
 		},
+		{
+			"label": _("Help"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Customer and Supplier"),
+					"youtube_id": "anoGi_RpQ20"
+				},
+			]
+		},
 	]
diff --git a/erpnext/config/crm.py b/erpnext/config/crm.py
index 48b8b2f..3a7ab18 100644
--- a/erpnext/config/crm.py
+++ b/erpnext/config/crm.py
@@ -128,4 +128,14 @@
 				},
 			]
 		},
+		{
+			"label": _("Help"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Lead to Quotation"),
+					"youtube_id": "TxYX4r4JAKA"
+				},
+			]
+		},
 	]
diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index a08fb50..b0c7345 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -62,5 +62,12 @@
 			"icon": "icon-phone",
 			"icon": "octicon octicon-issue-opened",
 			"type": "module"
+		},
+		"Learn": {
+			"color": "#7272FF",
+			"force_show": True,
+			"icon": "icon-facetime-video",
+			"type": "module",
+			"is_help": True
 		}
 	}
diff --git a/erpnext/config/learn.py b/erpnext/config/learn.py
new file mode 100644
index 0000000..146bb21
--- /dev/null
+++ b/erpnext/config/learn.py
@@ -0,0 +1,138 @@
+from __future__ import unicode_literals
+from frappe import _
+
+def get_data():
+	return [
+		{
+			"label": _("General"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Navigating"),
+					"youtube_id": "YDoI2DF4Lmc"
+				},
+				{
+					"type": "help",
+					"label": _("Setup Wizard"),
+					"youtube_id": "oIOf_zCFWKQ"
+				}
+
+			]
+
+		},
+		{
+			"label": _("Setup"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Data Import and Export"),
+					"youtube_id": "6wiriRKPhmg"
+				},
+				{
+					"type": "help",
+					"label": _("Opening Stock Balance"),
+					"youtube_id": "yPgrtfeCTs"
+				},
+				{
+					"type": "help",
+					"label": _("Setting up Email"),
+					"youtube_id": "YFYe0DrB95o"
+				},
+				{
+					"type": "help",
+					"label": _("Printing and Branding"),
+					"youtube_id": "cKZHcx1znMc"
+				},
+				{
+					"type": "help",
+					"label": _("Users and Permissions"),
+					"youtube_id": "fnBoRhBrwR4"
+				},
+				{
+					"type": "help",
+					"label": _("Workflow"),
+					"youtube_id": "yObJUg9FxFs"
+				},
+			]
+		},
+		{
+			"label": _("Accounts"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Chart of Accounts"),
+					"youtube_id": "DyR-DST-PyA"
+				},
+				{
+					"type": "help",
+					"label": _("Setting up Taxes"),
+					"youtube_id": "nQ1zZdPgdaQ"
+				},
+				{
+					"type": "help",
+					"label": _("Opening Accounting Balance"),
+					"youtube_id": "kdgM20Q-q68"
+				}
+			]
+		},
+		{
+			"label": _("CRM"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Lead to Quotation"),
+					"youtube_id": "TxYX4r4JAKA"
+				},
+			]
+		},
+		{
+			"label": _("Selling"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Customer and Supplier"),
+					"youtube_id": "anoGi_RpQ20"
+				},
+			]
+		},
+		{
+			"label": _("Stock"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Items and Pricing"),
+					"youtube_id": "qXaEwld4_Ps"
+				},
+				{
+					"type": "help",
+					"label": _("Opening Stock Balance"),
+					"youtube_id": "yPgrtfeCTs"
+				},
+				{
+					"type": "help",
+					"label": _("Item Variants"),
+					"youtube_id": "OGBETlCzU5o"
+				},
+			]
+		},
+		{
+			"label": _("Buying"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Customer and Supplier"),
+					"youtube_id": "anoGi_RpQ20"
+				},
+			]
+		},
+		{
+			"label": _("Manufacturing"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Bill of Materials"),
+					"youtube_id": "hDV0c1OeWLo"
+				},
+			]
+		}
+	]
diff --git a/erpnext/config/manufacturing.py b/erpnext/config/manufacturing.py
index 4fa8451..c2dacad 100644
--- a/erpnext/config/manufacturing.py
+++ b/erpnext/config/manufacturing.py
@@ -105,4 +105,15 @@
 				},
 			]
 		},
+		{
+			"label": _("Help"),
+			"icon": "icon-facetime-video",
+			"items": [
+				{
+					"type": "help",
+					"label": _("Bill of Materials"),
+					"youtube_id": "hDV0c1OeWLo"
+				},
+			]
+		}
 	]
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
index 91c44d0..7f8d517 100644
--- a/erpnext/config/selling.py
+++ b/erpnext/config/selling.py
@@ -275,4 +275,14 @@
 				},
 			]
 		},
+		{
+			"label": _("Help"),
+			"items": [
+				{
+					"type": "help",
+					"label": _("Customer and Supplier"),
+					"youtube_id": "anoGi_RpQ20"
+				},
+			]
+		},
 	]
diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py
index a33fd539..961e4f7 100644
--- a/erpnext/config/setup.py
+++ b/erpnext/config/setup.py
@@ -44,6 +44,36 @@
 			]
 		},
 		{
+			"label": _("Help"),
+			"items": [
+				{
+					"type": "help",
+					"name": _("Data Import and Export"),
+					"youtube_id": "6wiriRKPhmg"
+				},
+				{
+					"type": "help",
+					"label": _("Setting up Email"),
+					"youtube_id": "YFYe0DrB95o"
+				},
+				{
+					"type": "help",
+					"label": _("Printing and Branding"),
+					"youtube_id": "cKZHcx1znMc"
+				},
+				{
+					"type": "help",
+					"label": _("Users and Permissions"),
+					"youtube_id": "fnBoRhBrwR4"
+				},
+				{
+					"type": "help",
+					"label": _("Workflow"),
+					"youtube_id": "yObJUg9FxFs"
+				},
+			]
+		},
+		{
 			"label": _("Customize"),
 			"icon": "icon-glass",
 			"items": [
diff --git a/erpnext/config/stock.py b/erpnext/config/stock.py
index d3481b5..86ec458 100644
--- a/erpnext/config/stock.py
+++ b/erpnext/config/stock.py
@@ -254,4 +254,25 @@
 				},
 			]
 		},
+		{
+			"label": _("Help"),
+			"icon": "icon-facetime-video",
+			"items": [
+				{
+					"type": "help",
+					"label": _("Items and Pricing"),
+					"youtube_id": "qXaEwld4_Ps"
+				},
+				{
+					"type": "help",
+					"label": _("Opening Stock Balance"),
+					"youtube_id": "yPgrtfeCTs"
+				},
+				{
+					"type": "help",
+					"label": _("Item Variants"),
+					"youtube_id": "OGBETlCzU5o"
+				},
+			]
+		}
 	]
diff --git a/erpnext/manufacturing/doctype/bom/bom_list.js b/erpnext/manufacturing/doctype/bom/bom_list.js
index c73ed0d..2b06ed7 100644
--- a/erpnext/manufacturing/doctype/bom/bom_list.js
+++ b/erpnext/manufacturing/doctype/bom/bom_list.js
@@ -10,3 +10,5 @@
 		}
 	}
 };
+
+frappe.help.youtube_id["BOM"] = "hDV0c1OeWLo";
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index c6beeff..6eaa492 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -14,3 +14,5 @@
 		}
 	}
 };
+
+frappe.help.youtube_id["Item"] = "qXaEwld4_Ps";