How to overwrite a frappe js

I need tham all the lists to load by default 20 items, but I need to change the following frappe file, it is possible without changing the core frappe file.Can I overwrite this file?

Path:
frappe/frappe/public/js/frappe/ui/filters/filters.js

Method:
frappe.ui.FilterList = Class.extend({
init: function(opts) {
$.extend(this, opts);
this.filters = [];
this.wrapper = this.$parent;
this.stats = [];
this.make();
this.set_events();
this.listobj.page_length = 20;
},

Go to the Purchase Order DocType’s file and open purchase_order_list.js.

In that after the end of onload function add this page_length: 500.

Your file should look like

.
.
.
	onload: function (listview) {
		var method = "erpnext.buying.doctype.purchase_order.purchase_order.close_or_unclose_purchase_orders";

		listview.page.add_menu_item(__("Close"), function () {
			listview.call_for_selected_items(method, { "status": "Closed" });
		});

		listview.page.add_menu_item(__("Re-open"), function () {
			listview.call_for_selected_items(method, { "status": "Submitted" });
		});
	},
	page_length: 500
1 Like

Thanks for replying, I put the purchase order example, but I would like to apply this to all lists(Doctype).