[cleanup] rename "links" to "dashboard"
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 4bc634a..3fbe99d 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -29,8 +29,6 @@
 			cur_frm.msgbox.hide();
 		}
 
-		cur_frm.dashboard.reset();
-
 		this.frm.toggle_reqd("due_date", !this.frm.doc.is_return);
 
 		this.show_general_ledger();
@@ -68,11 +66,11 @@
 			if(doc.outstanding_amount!=0 && !cint(doc.is_return)) {
 				cur_frm.add_custom_button(__('Payment'), this.make_payment_entry, __("Make"));
 			}
-			
+
 			if(doc.outstanding_amount>0 && !cint(doc.is_return)) {
 				cur_frm.add_custom_button(__('Payment Request'), this.make_payment_request, __("Make"));
 			}
-			
+
 
 		}
 
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index f5d4e2e..107fbc0 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -17,7 +17,6 @@
 	refresh: function(doc, cdt, cdn) {
 		var me = this;
 		this._super();
-		// this.frm.dashboard.reset();
 		var allow_receipt = false;
 		var is_drop_ship = false;
 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index e526034..9a81467 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -39,7 +39,6 @@
 
 	refresh: function(frm, cdt, cdn) {
 		if (frm.doc.docstatus === 1) {
-			frm.dashboard.show_dashboard();
 			frm.add_custom_button(__("Make"),
 				function(){ frm.trigger("make_suppplier_quotation") }, __("Supplier Quotation"));
 
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_links.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
similarity index 90%
rename from erpnext/buying/doctype/request_for_quotation/request_for_quotation_links.py
rename to erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
index 279d157..7a69bf9 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation_links.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation_dashboard.py
@@ -1,6 +1,7 @@
 from frappe import _
 
-links = {
+data = {
+	'docstatus': 1,
 	'fieldname': 'request_for_quotation',
 	# 'non_standard_fieldnames': {
 	# 	'Purchase Order': 'prevdoc_detail_docname',
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index f23885a..1df1eec 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -6,10 +6,6 @@
 		frappe.setup_language_field(frm);
 	},
 	refresh: function(frm) {
-		frm.dashboard.show_heatmap = true;
-		frm.dashboard.heatmap_message = __('This is based on transactions against this Supplier. See timeline below for details');
-		frm.dashboard.show_dashboard();
-
 		if(frappe.defaults.get_default("supp_master_name")!="Naming Series") {
 			frm.toggle_display("naming_series", false);
 		} else {
diff --git a/erpnext/buying/doctype/supplier/supplier_links.py b/erpnext/buying/doctype/supplier/supplier_dashboard.py
similarity index 66%
rename from erpnext/buying/doctype/supplier/supplier_links.py
rename to erpnext/buying/doctype/supplier/supplier_dashboard.py
index 10cf3fa..ab123e2 100644
--- a/erpnext/buying/doctype/supplier/supplier_links.py
+++ b/erpnext/buying/doctype/supplier/supplier_dashboard.py
@@ -1,6 +1,8 @@
 from frappe import _
 
-links = {
+data = {
+	'heatmap': True,
+	'heatmap_message': _('This is based on transactions against this Supplier. See timeline below for details'),
 	'fieldname': 'supplier',
 	'transactions': [
 		{
diff --git a/erpnext/crm/doctype/opportunity/opportunity_dashboard.py b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
new file mode 100644
index 0000000..6442d35
--- /dev/null
+++ b/erpnext/crm/doctype/opportunity/opportunity_dashboard.py
@@ -0,0 +1,11 @@
+from frappe import _
+
+data = {
+	'fieldname': 'prevdoc_docname',
+	'transactions': [
+		{
+			'label': _('Related Documents'),
+			'items': ['Quotation']
+		},
+	]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 8857bad..bb9edf9 100755
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -24,9 +24,6 @@
 	refresh: function() {
 		var me = this;
 		erpnext.toggle_naming_series();
-		this.frm.dashboard.show_heatmap = true;
-		this.frm.dashboard.heatmap_message = __('This is based on the attendance of this Employee');
-		this.frm.dashboard.show_dashboard();
 	},
 
 	date_of_birth: function() {
diff --git a/erpnext/hr/doctype/employee/employee_links.py b/erpnext/hr/doctype/employee/employee_dashboard.py
similarity index 79%
rename from erpnext/hr/doctype/employee/employee_links.py
rename to erpnext/hr/doctype/employee/employee_dashboard.py
index 027567e..420c1df 100644
--- a/erpnext/hr/doctype/employee/employee_links.py
+++ b/erpnext/hr/doctype/employee/employee_dashboard.py
@@ -1,6 +1,8 @@
 from frappe import _
 
-links = {
+data = {
+	'heatmap': True,
+	'heatmap_message': _('This is based on the attendance of this Employee'),
 	'fieldname': 'employee',
 	'transactions': [
 		{
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 5cef75c..a0f52dd 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -66,10 +66,6 @@
 		});
 	},
 	show_dashboard: function(frm) {
-		frm.dashboard.show_heatmap = true;
-		frm.dashboard.heatmap_message = __('This is based on the Time Sheet created against this project');
-		frm.dashboard.show_dashboard();
-
 		if(frm.doc.__onload.activity_summary.length) {
 			var hours = $.map(frm.doc.__onload.activity_summary, function(d) { return d.total_hours });
 			var max_count = Math.max.apply(null, hours);
diff --git a/erpnext/projects/doctype/project/project_links.py b/erpnext/projects/doctype/project/project_dashboard.py
similarity index 79%
rename from erpnext/projects/doctype/project/project_links.py
rename to erpnext/projects/doctype/project/project_dashboard.py
index 0af1e1a..b36df88 100644
--- a/erpnext/projects/doctype/project/project_links.py
+++ b/erpnext/projects/doctype/project/project_dashboard.py
@@ -1,6 +1,8 @@
 from frappe import _
 
-links = {
+data = {
+	'heatmap': True,
+	'heatmap_message': _('This is based on the Time Sheets created against this project'),
 	'fieldname': 'project',
 	'transactions': [
 		{
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 3556be7..af97fed 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -6,10 +6,6 @@
 		frappe.setup_language_field(frm);
 	},
 	refresh: function(frm) {
-		frm.dashboard.show_heatmap = true;
-		frm.dashboard.heatmap_message = __('This is based on transactions against this Customer. See timeline below for details');
-		frm.dashboard.show_dashboard();
-
 		if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
 			frm.toggle_display("naming_series", false);
 		} else {
@@ -45,7 +41,7 @@
 	if(fields_to_refresh) { refresh_many(fields_to_refresh); }
 }
 
-cur_frm.add_fetch('lead_name', 'company_name', 'customer_name');
+cur_frm.add_fetch('lead_name', ('company_name', 'customer_name');
 cur_frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate');
 
 cur_frm.fields_dict['customer_group'].get_query = function(doc, dt, dn) {
diff --git a/erpnext/selling/doctype/customer/customer_links.py b/erpnext/selling/doctype/customer/customer_dashboard.py
similarity index 72%
rename from erpnext/selling/doctype/customer/customer_links.py
rename to erpnext/selling/doctype/customer/customer_dashboard.py
index 32bedde..b65c199 100644
--- a/erpnext/selling/doctype/customer/customer_links.py
+++ b/erpnext/selling/doctype/customer/customer_dashboard.py
@@ -1,6 +1,8 @@
 from frappe import _
 
-links = {
+data = {
+	'heatmap': True,
+	'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
 	'fieldname': 'customer',
 	'transactions': [
 		{
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 5f1a5c7..d8ed591 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -18,10 +18,9 @@
 erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend({
 	refresh: function(doc, dt, dn) {
 		this._super();
-		this.frm.dashboard.reset();
 		var allow_purchase = false;
 		var allow_delivery = false;
-		
+
 		if(doc.docstatus==1) {
 			if(doc.status != 'Closed') {
 
@@ -80,7 +79,7 @@
 				}
 
 				// maintenance
-				if(flt(doc.per_delivered, 2) < 100 && 
+				if(flt(doc.per_delivered, 2) < 100 &&
 						["Sales", "Shopping Cart"].indexOf(doc.order_type)===-1) {
 					cur_frm.add_custom_button(__('Maintenance Visit'), this.make_maintenance_visit, __("Make"));
 					cur_frm.add_custom_button(__('Maintenance Schedule'), this.make_maintenance_schedule, __("Make"));
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index d3d4bcc..8ee3d03 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -172,19 +172,19 @@
 		frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
 			return { query: "erpnext.controllers.queries.supplier_query" }
 		}
-		
+
 		frm.fields_dict['default_warehouse'].get_query = function(doc) {
 			return {
 				filters: { "is_group": 0 }
 			}
 		}
-		
+
 		frm.fields_dict.reorder_levels.grid.get_field("warehouse_group").get_query = function(doc, cdt, cdn) {
 			return {
 				filters: { "is_group": 1 }
 			}
 		}
-		
+
 		frm.fields_dict.reorder_levels.grid.get_field("warehouse").get_query = function(doc, cdt, cdn) {
 			var d = locals[cdt][cdn];
 			return {
@@ -198,15 +198,9 @@
 	},
 
 	make_dashboard: function(frm) {
-		frm.dashboard.reset();
 		if(frm.doc.__islocal)
 			return;
 
-		frm.dashboard.show_heatmap = frm.doc.is_stock_item;
-		frm.dashboard.heatmap_message = __('This is based on stock movement. See {0} for details',
-			['<a href="#query-report/Stock Ledger">' + __('Stock Ledger') + '</a>']);
-		frm.dashboard.show_dashboard();
-
 		frappe.require('assets/js/item-dashboard.min.js', function() {
 			var section = frm.dashboard.add_section('<h5 style="margin-top: 0px;"><a href="#stock-balance">Stock Levels</a></h5>');
 			erpnext.item.item_dashboard = new erpnext.stock.ItemDashboard({
diff --git a/erpnext/stock/doctype/item/item_links.py b/erpnext/stock/doctype/item/item_dashboard.py
similarity index 81%
rename from erpnext/stock/doctype/item/item_links.py
rename to erpnext/stock/doctype/item/item_dashboard.py
index 68280dc..e0f1c21 100644
--- a/erpnext/stock/doctype/item/item_links.py
+++ b/erpnext/stock/doctype/item/item_dashboard.py
@@ -1,6 +1,9 @@
 from frappe import _
 
-links = {
+data = {
+	'heatmap': True,
+	'heatmap_message': _('This is based on stock movement. See {0} for details')\
+		.format('<a href="#query-report/Stock Ledger">' + _('Stock Ledger') + '</a>'),
 	'fieldname': 'item_code',
 	'non_standard_fieldnames': {
 		'Production Order': 'production_item',
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index f6a7c66..0a07582 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -49,9 +49,6 @@
 		}
 
 		if(doc.docstatus == 1 && doc.status != 'Stopped') {
-
-			// this.frm.dashboard.show_dashboard();
-
 			if(flt(doc.per_ordered, 2) < 100) {
 				// make
 				if(doc.material_request_type === "Material Transfer" && doc.status === "Submitted")
diff --git a/erpnext/stock/doctype/material_request/material_request_links.py b/erpnext/stock/doctype/material_request/material_request_dashboard.py
similarity index 91%
rename from erpnext/stock/doctype/material_request/material_request_links.py
rename to erpnext/stock/doctype/material_request/material_request_dashboard.py
index abd27dc..aa341a8 100644
--- a/erpnext/stock/doctype/material_request/material_request_links.py
+++ b/erpnext/stock/doctype/material_request/material_request_dashboard.py
@@ -1,6 +1,7 @@
 from frappe import _
 
-links = {
+data = {
+	'docstatus': 1,
 	'fieldname': 'material_request',
 	'non_standard_fieldnames': {
 		'Purchase Order': 'prevdoc_detail_docname',