Fixed a bug where Tasks weren't loading filtered by Job.

This commit is contained in:
rocketdebris 2025-12-23 17:27:16 -05:00
parent b2f77f2ca1
commit 48431db7ee
3 changed files with 7 additions and 5 deletions

View File

@ -23,18 +23,19 @@ def get_job_task_table_data(filters={}, sortings={}, page=1, page_size=10):
processed_filters, processed_sortings, is_or, page, page_size = process_query_conditions(filters, sortings, page, page_size)
print("DEBUG: Processed Filters:", processed_filters)
if is_or:
count = frappe.db.sql(*get_count_or_filters("Task", processed_filters))[0][0]
count = frappe.db.sql(*get_count_or_filters("Task", filters))[0][0]
else:
count = frappe.db.count("Task", filters=processed_filters)
count = frappe.db.count("Task", filters=filters)
print(f"DEBUG: Number of tasks returned: {count}")
tasks = frappe.db.get_all(
"Task",
fields=["*"],
filters=processed_filters if not is_or else None,
or_filters=processed_filters if is_or else None,
filters=filters,
limit=page_size,
start=(page - 1) * page_size,
order_by=processed_sortings

View File

@ -320,7 +320,7 @@ class Api {
console.log("DEBUG: API - Sending job task options to backend:", options);
const result = await this.request(FRAPPE_GET_JOB_TASK_LIST_METHOD, { options });
const result = await this.request(FRAPPE_GET_JOB_TASK_LIST_METHOD, { options, filters });
return result;
}

View File

@ -78,6 +78,7 @@ const taskList = ref(null);
const columns = [
{ label: "Task", fieldName: "subject", type: "text" },
{ label: "ID", fieldName: "name", type: "text", sortable: true, filterable: true },
{ label: "Address", fieldname: "address", type: "text" },
{ label: "Category", fieldName: "", type: "text", sortable: true, filterable: true },
{ label: "Status", fieldName: "status", type: "text", sortable: true, filterable: true },
];