diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 4bc634a323..3fbe99dcdd 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -29,8 +29,6 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte 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 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte 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 f5d4e2e4cf..107fbc0a9b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -17,7 +17,6 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( 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 e526034b07..9a81467552 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 @@ frappe.ui.form.on("Request for Quotation",{ 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 279d1570f8..7a69bf960e 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 f23885a758..1df1eec819 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -6,10 +6,6 @@ frappe.ui.form.on("Supplier", { 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 10cf3fa8aa..ab123e2d8d 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 0000000000..6442d35808 --- /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 8857bad955..bb9edf9e88 100755 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -24,9 +24,6 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({ 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 80% rename from erpnext/hr/doctype/employee/employee_links.py rename to erpnext/hr/doctype/employee/employee_dashboard.py index 027567eaa6..420c1df366 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 5cef75c65c..a0f52dda09 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -66,10 +66,6 @@ frappe.ui.form.on("Project", { }); }, 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 0af1e1a3b9..b36df88e4b 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 3556be757d..af97fed3f6 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -6,10 +6,6 @@ frappe.ui.form.on("Customer", { 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 @@ cur_frm.cscript.load_defaults = function(doc, dt, dn) { 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 32bedded77..b65c1995eb 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 5f1a5c722c..d8ed59189f 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -18,10 +18,9 @@ frappe.ui.form.on("Sales Order", { 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 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend( } // 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 d3d4bccc08..8ee3d0317b 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -172,19 +172,19 @@ $.extend(erpnext.item, { 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 @@ $.extend(erpnext.item, { }, 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', - ['' + __('Stock Ledger') + '']); - frm.dashboard.show_dashboard(); - frappe.require('assets/js/item-dashboard.min.js', function() { var section = frm.dashboard.add_section('