fix: Project filter in timesheet

This commit is contained in:
Deepesh Garg 2022-11-07 22:48:52 +05:30
parent 30daeb90a8
commit 2b65b22aa2

View File

@ -92,18 +92,26 @@ frappe.ui.form.on("Timesheet", {
frm.fields_dict["time_logs"].grid.toggle_enable("billing_hours", false);
frm.fields_dict["time_logs"].grid.toggle_enable("is_billable", false);
}
let filters = {
"status": "Open"
};
if (frm.doc.customer) {
filters["customer"] = frm.doc.customer;
}
frm.set_query('parent_project', function(doc) {
return {
filters: filters
};
});
frm.trigger('setup_filters');
frm.trigger('set_dynamic_field_label');
},
customer: function(frm) {
frm.set_query('parent_project', function(doc) {
return {
filters: {
"customer": doc.customer
}
};
});
frm.set_query('project', 'time_logs', function(doc) {
return {
filters: {