From 37bed12df463a16baac209d1a34fa97fdfe7fd80 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 7 Nov 2022 22:48:52 +0530 Subject: [PATCH 1/3] fix: Project filter in timesheet (cherry picked from commit 2b65b22aa2d9fd6d7ff4b407ecd1bd01f4bc43fa) --- .../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 e1486de18c6..a376bf46a5b 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 6163a052c8a27e4dcdeba5948e39a764f8ba0230 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 8 Nov 2022 11:00:48 +0530 Subject: [PATCH 2/3] chore: Linting Issues (cherry picked from commit 7b5cf6978ed11fa251dce7bbb961088ac20ab1d6) # Conflicts: # erpnext/manufacturing/doctype/workstation/workstation.py --- erpnext/manufacturing/doctype/workstation/workstation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index 59e5318ab8d..d07bd8f0e6a 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -100,9 +100,13 @@ def get_default_holiday_list(): def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime): if from_datetime and to_datetime: +<<<<<<< HEAD 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")): +>>>>>>> 7b5cf6978e (chore: Linting Issues) check_workstation_for_holiday(workstation, from_datetime, to_datetime) if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")): From 19b3152e32bf1c1881053de5cd33c6d40d0684e0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 8 Nov 2022 17:42:29 +0530 Subject: [PATCH 3/3] chore: Resolve conflicts --- erpnext/manufacturing/doctype/workstation/workstation.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index d07bd8f0e6a..5e57fcd8e96 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -100,13 +100,10 @@ def get_default_holiday_list(): def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime): if from_datetime and to_datetime: -<<<<<<< HEAD + 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")): ->>>>>>> 7b5cf6978e (chore: Linting Issues) check_workstation_for_holiday(workstation, from_datetime, to_datetime) if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")):