mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-16 08:47:33 +00:00
Merge pull request #32891 from frappe/mergify/bp/version-14-hotfix/pr-32883
fix: Project filter in timesheet (backport #32883)
This commit is contained in:
@@ -100,6 +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")
|
||||
):
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user