Try ERPNext Buy Support Partners Foundation

Timesheet filter group projects

Hi,

I’m trying to filter the tasks that can be selected when adding timesheets to only subtasks and not parent type tasks. A parent task being a task that has the is_group checkbox selected.

I’ve tried the following custom script but i can’t seem to make it work. Any ideas are greatly appreciated.

frappe.ui.form.on(‘Timesheet’, {
refresh(frm) {

		frm.fields_dict['task'].grid.get_field('is_group').get_query = function(doc, cdt, cdn) {
    var child = locals[cdt][cdn];
    //console.log(child);
    return {    
        filters:[
            ['task.is_group', '=', 0]
        ]
    }
}

}
})

Thanks

Hoping to get some help - please? Anyone - thanks