From 2b65b22aa2d9fd6d7ff4b407ecd1bd01f4bc43fa Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 7 Nov 2022 22:48:52 +0530 Subject: [PATCH 1/2] fix: Project filter in timesheet --- .../projects/doctype/timesheet/timesheet.js | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index e1486de18c..a376bf46a5 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -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: { From 7b5cf6978ed11fa251dce7bbb961088ac20ab1d6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 8 Nov 2022 11:00:48 +0530 Subject: [PATCH 2/2] chore: Linting Issues --- erpnext/manufacturing/doctype/workstation/workstation.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index 76795e3c56..471ea47710 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -100,9 +100,7 @@ def get_default_holiday_list(): def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime): if from_datetime and to_datetime: - if not cint( - frappe.db.get_value("Manufacturing Settings", None, "allow_production_on_holidays") - ): + if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_production_on_holidays")): check_workstation_for_holiday(workstation, from_datetime, to_datetime) if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")):