How to override list_view.js file using custom app

Hello Community,

I am trying to override the list_view.js file through the custom app but as mentioned in the documentation, the file is not getting overridden. So is there any different way to override that file or is it the same way? If anyone has tried it, please help me with it.

Here is the file path.
File Path :- apps>frappe>frappe>public>js>frappe>list>list_view.js

Thanks in advance.

Please mention the doctype and path in hooks.py

Thanks For your reply but I want to use the same code in the list view for all doctypes. So how can I override the code using a custom app and hooks.py? Your answer is correct but it’s just for one doctype. I want to override the code because I want to change the layout and color of the system so please guide me.

Have a look in to this List

If anyone is getting trouble getting this to work, I found out how to get it working:

Place a file XYZ.js in your public/js folder (should be your-custom-app/your-custom-app/public/js/XYZ.js)

Place the relevant code inside

frappe.listview_settings["DOCTYPE"] = {
 ...
}

Now on your hooks.py don´t reference it using the normal path you did for doctype_js or app_include_js, instead use exactly doctype_list_js = {"Item" : "public/js/XYZ.js"}

Now it works. I just wasted 2 hours getting this to work just to discover that the bundler takes the file and merges it with the frappe build, so your file is never directly sent to the client via a single request, instead it just get bundled on the fly.