fixes #1581 and added icons to grid reports

This commit is contained in:
Rushabh Mehta 2014-05-27 15:22:04 +05:30
parent d82e85d099
commit f944e819e9
11 changed files with 17 additions and 11 deletions

View File

@ -238,6 +238,9 @@ erpnext.AccountsChart = Class.extend({
method: 'erpnext.accounts.utils.add_ac', method: 'erpnext.accounts.utils.add_ac',
callback: function(r) { callback: function(r) {
d.hide(); d.hide();
if(node.expanded) {
node.toggle_node();
}
node.reload(); node.reload();
} }
}); });
@ -281,6 +284,9 @@ erpnext.AccountsChart = Class.extend({
method: 'erpnext.accounts.utils.add_cc', method: 'erpnext.accounts.utils.add_cc',
callback: function(r) { callback: function(r) {
d.hide(); d.hide();
if(node.expanded) {
node.toggle_node();
}
node.reload(); node.reload();
} }
}); });

View File

@ -45,7 +45,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_columns: function() { setup_columns: function() {
var std_columns = [ var std_columns = [

View File

@ -102,7 +102,7 @@ erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -69,7 +69,7 @@ erpnext.AccountTreeGrid = frappe.views.TreeGridReport.extend({
{fieldtype: "Date", label: __("To Date")}, {fieldtype: "Date", label: __("To Date")},
{fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white", {fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white",
cssClass:"btn-info"}, cssClass:"btn-info"},
{fieldtype: "Button", label: __("Reset Filters")}, {fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"},
], ],
setup_filters: function() { setup_filters: function() {
this._super(); this._super();

View File

@ -66,7 +66,7 @@ erpnext.StockAnalytics = erpnext.StockGridReport.extend({
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -147,10 +147,10 @@ erpnext.SalesChart = Class.extend({
callback: function(r) { callback: function(r) {
if(!r.exc) { if(!r.exc) {
d.hide(); d.hide();
node.reload(); if(node.expanded) {
if(!node.expanded) {
node.toggle_node(); node.toggle_node();
} }
node.reload();
} }
} }
}); });

View File

@ -60,7 +60,7 @@ erpnext.StockAgeing = erpnext.StockGridReport.extend({
options: ["Average Age", "Earliest", "Latest"]}, options: ["Average Age", "Earliest", "Latest"]},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date")},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_filters: function() { setup_filters: function() {
var me = this; var me = this;

View File

@ -71,7 +71,7 @@ erpnext.StockBalance = erpnext.StockAnalytics.extend({
{fieldtype:"Label", label: __("To")}, {fieldtype:"Label", label: __("To")},
{fieldtype:"Date", label: __("To Date")}, {fieldtype:"Date", label: __("To Date")},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_plot_check: function() { setup_plot_check: function() {

View File

@ -85,7 +85,7 @@ erpnext.StockLedger = erpnext.StockGridReport.extend({
return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date); return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date);
}}, }},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_filters: function() { setup_filters: function() {

View File

@ -99,7 +99,7 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({
return val == opts.default_value || item.brand == val; return val == opts.default_value || item.brand == val;
}}, }},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_filters: function() { setup_filters: function() {

View File

@ -35,7 +35,7 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({
{fieldtype:"Select", label: __("Range"), {fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]}, options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"}, {fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
{fieldtype:"Button", label: __("Reset Filters")} {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
], ],
setup_columns: function() { setup_columns: function() {