Auto filtering out completed, cancelled, and templated tasks.
This commit is contained in:
parent
f8694cf8d4
commit
adb7bc5930
1 changed files with 6 additions and 3 deletions
|
|
@ -21,15 +21,18 @@ def get_tasks_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['status'] = ["not in", ["Template", "Completed", "Cancelled"]]
|
||||
|
||||
print("Processed filters:", processed_filters)
|
||||
|
||||
count = frappe.db.count("Task", filters=processed_filters)
|
||||
|
||||
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=processed_filters,
|
||||
limit=page_size,
|
||||
start=(page - 1) * page_size,
|
||||
start=page * page_size,
|
||||
order_by=processed_sortings
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue