diff --git a/js/wn/views/doclistview.js b/js/wn/views/doclistview.js index 57d66a5437..cbf1b8818f 100644 --- a/js/wn/views/doclistview.js +++ b/js/wn/views/doclistview.js @@ -178,7 +178,7 @@ wn.views.DocListView = wn.ui.Listing.extend({ return this.listview.fields; }, get_args: function() { - return { + var args = { doctype: this.doctype, fields: this.get_query_fields(), filters: this.filter_list.get_filters(), @@ -187,6 +187,13 @@ wn.views.DocListView = wn.ui.Listing.extend({ order_by: this.listview.order_by || undefined, group_by: this.listview.group_by || undefined, } + + // apply default filters, if specified for a listing + $.each((this.listview.default_filters || []), function(i, f) { + args.filters.push(f); + }); + + return args; }, add_delete_option: function() { var me = this; @@ -550,9 +557,11 @@ wn.views.RecordListView = wn.views.DocListView.extend({ get_args: function() { var args = this._super(); + $.each((this.default_filters || []), function(i, f) { args.filters.push(f); }); + args.docstatus = args.docstatus.concat((this.default_docstatus || [])); return args; }, diff --git a/js/wn/views/grid_report.js b/js/wn/views/grid_report.js index 4a97f3462a..f5318d0b55 100644 --- a/js/wn/views/grid_report.js +++ b/js/wn/views/grid_report.js @@ -278,6 +278,7 @@ wn.views.GridReport = Class.extend({ }); }, make: function() { + var me = this; // plot wrapper this.plot_area = $('