From 8c0f05fbae83a613b50df4e96be7f6facb3d1284 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 17 Feb 2015 19:53:23 +0530 Subject: [PATCH] [minor] grid report loading --- .../page/financial_analytics/financial_analytics.js | 8 ++++---- .../buying/page/purchase_analytics/purchase_analytics.js | 5 +++-- erpnext/public/js/account_tree_grid.js | 2 ++ erpnext/public/js/stock_grid_report.js | 2 ++ erpnext/selling/page/sales_analytics/sales_analytics.js | 4 +++- erpnext/stock/page/stock_analytics/stock_analytics.js | 9 +++++---- erpnext/stock/page/stock_ledger/stock_ledger.js | 2 +- .../support/page/support_analytics/support_analytics.js | 2 ++ 8 files changed, 22 insertions(+), 12 deletions(-) diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js index 4e507113ae..a895aadc4f 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.js +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js @@ -1,8 +1,6 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -frappe.require("assets/erpnext/js/account_tree_grid.js"); - frappe.pages['financial-analytics'].on_page_load = function(wrapper) { frappe.ui.make_app_page({ parent: wrapper, @@ -10,9 +8,11 @@ frappe.pages['financial-analytics'].on_page_load = function(wrapper) { single_column: true }); erpnext.financial_analytics = new erpnext.FinancialAnalytics(wrapper, 'Financial Analytics'); - frappe.add_breadcrumbs("Accounts") + frappe.add_breadcrumbs("Accounts"); -} +}; + +frappe.require("assets/erpnext/js/account_tree_grid.js"); erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ filters: [ diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js index 33fb9b2f54..470e44c15c 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js @@ -11,10 +11,11 @@ frappe.pages['purchase-analytics'].on_page_load = function(wrapper) { new erpnext.PurchaseAnalytics(wrapper); - frappe.add_breadcrumbs("Buying") - + frappe.add_breadcrumbs("Buying"); } +frappe.assets.views["Report"](); + erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({ init: function(wrapper) { this._super({ diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js index dde943a478..729e88deee 100644 --- a/erpnext/public/js/account_tree_grid.js +++ b/erpnext/public/js/account_tree_grid.js @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +frappe.assets.views["Report"](); + erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({ init: function(wrapper, title) { this._super({ diff --git a/erpnext/public/js/stock_grid_report.js b/erpnext/public/js/stock_grid_report.js index 726852f7ce..e1f97f8830 100644 --- a/erpnext/public/js/stock_grid_report.js +++ b/erpnext/public/js/stock_grid_report.js @@ -1,6 +1,8 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt +frappe.assets.views["Report"](); + erpnext.StockGridReport = frappe.views.TreeGridReport.extend({ get_item_warehouse: function(warehouse, item) { if(!this.item_warehouse[item]) this.item_warehouse[item] = {}; diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js index ad2102a877..bbe69d7c3e 100644 --- a/erpnext/selling/page/sales_analytics/sales_analytics.js +++ b/erpnext/selling/page/sales_analytics/sales_analytics.js @@ -12,7 +12,9 @@ frappe.pages['sales-analytics'].on_page_load = function(wrapper) { frappe.add_breadcrumbs("Selling") -} +}; + +frappe.assets.views["Report"](); erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({ init: function(wrapper) { diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js index 346750bcd7..0b7acb82dc 100644 --- a/erpnext/stock/page/stock_analytics/stock_analytics.js +++ b/erpnext/stock/page/stock_analytics/stock_analytics.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt -frappe.pages['stock-analytics'].on_page_load = function(wrapper) { +frappe.pages['stock-analytics'].on_page_load = function(wrapper) { frappe.ui.make_app_page({ parent: wrapper, title: __('Stock Analytics'), @@ -13,7 +13,8 @@ frappe.pages['stock-analytics'].on_page_load = function(wrapper) { frappe.add_breadcrumbs("Stock") - -} -frappe.require("assets/erpnext/js/stock_analytics.js"); \ No newline at end of file +}; + +frappe.assets.views["Report"](); +frappe.require("assets/erpnext/js/stock_analytics.js"); diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js index 3f6a9e30bc..27525e93f3 100644 --- a/erpnext/stock/page/stock_ledger/stock_ledger.js +++ b/erpnext/stock/page/stock_ledger/stock_ledger.js @@ -10,7 +10,7 @@ frappe.pages['stock-ledger'].on_page_load = function(wrapper) { new erpnext.StockLedger(wrapper); frappe.add_breadcrumbs("Stock") -} +}; frappe.require("assets/erpnext/js/stock_grid_report.js"); diff --git a/erpnext/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js index 4ca15a25e6..057aebc63b 100644 --- a/erpnext/support/page/support_analytics/support_analytics.js +++ b/erpnext/support/page/support_analytics/support_analytics.js @@ -15,6 +15,8 @@ frappe.pages['support-analytics'].on_page_load = function(wrapper) { } +frappe.assets.views["Report"](); + erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({ init: function(wrapper) { this._super({