Fixed a bug where Tasks weren't loading filtered by Job.
This commit is contained in:
parent
b2f77f2ca1
commit
48431db7ee
3 changed files with 7 additions and 5 deletions
|
|
@ -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)
|
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:
|
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:
|
else:
|
||||||
count = frappe.db.count("Task", filters=processed_filters)
|
count = frappe.db.count("Task", filters=filters)
|
||||||
|
|
||||||
print(f"DEBUG: Number of tasks returned: {count}")
|
print(f"DEBUG: Number of tasks returned: {count}")
|
||||||
|
|
||||||
tasks = frappe.db.get_all(
|
tasks = frappe.db.get_all(
|
||||||
"Task",
|
"Task",
|
||||||
fields=["*"],
|
fields=["*"],
|
||||||
filters=processed_filters if not is_or else None,
|
filters=filters,
|
||||||
or_filters=processed_filters if is_or else None,
|
|
||||||
limit=page_size,
|
limit=page_size,
|
||||||
start=(page - 1) * page_size,
|
start=(page - 1) * page_size,
|
||||||
order_by=processed_sortings
|
order_by=processed_sortings
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,7 @@ class Api {
|
||||||
|
|
||||||
console.log("DEBUG: API - Sending job task options to backend:", options);
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ const taskList = ref(null);
|
||||||
const columns = [
|
const columns = [
|
||||||
{ label: "Task", fieldName: "subject", type: "text" },
|
{ label: "Task", fieldName: "subject", type: "text" },
|
||||||
{ label: "ID", fieldName: "name", type: "text", sortable: true, filterable: true },
|
{ 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: "Category", fieldName: "", type: "text", sortable: true, filterable: true },
|
||||||
{ label: "Status", fieldName: "status", type: "text", sortable: true, filterable: true },
|
{ label: "Status", fieldName: "status", type: "text", sortable: true, filterable: true },
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue