Change default filter in Task list view

Hi all,

We’re implementing ERPNext internally, to be able to track the projects we’re working on. We’ve started a proof of concept using the ERPNext v12 production ova file, ran in VirtualBox.

In the Task list view within the Projects module we need, for any user accessing this page, to automatically show the active tasks for the logged user (be automatically filtered by the logged user and status not being ‘Completed’ or ‘Cancelled’), sorted by ‘Expected End Date’ ascending.

I’ve looked on the forum for possible solutions and I’ve tried:

  1. Editing the task_list.js file in the projects/doctype/task folder, and
  2. Creating a new task_list.js file in the public folder; the task_list.js file contains a simple filter for the task status, see below:

The problem I have is that the task_list.js file doesn’t have any effect. Also, I cannot find the task_list.js while looking at the sources with the developer tools in the browser.

Therefore, I have the following questions:

  1. Is this solution, with setting filters in the task_list.js, the correct one?
  2. If yes, am I missing something? Should I recompile the app, or something like this?
  3. Is there any other, and better, solution for what we need (bolded above)?

Any help is much appreciated!

Regards,
Bogdan

Not sure about v12, the newer versions have a Report View which might be better suited. Limiting the filter to the current user might require some modification, from what I can tell.

I’m not on v12 but here are some options:

You could try the frappe.route_options method as stated in here How to set the default filters in the list view

To override the source code, you may need to use the hooks as discussed here Default filter in list view

There’s also Save Filter if nothing else works. Good luck!