Added a Select component to the Actions section of the Datatable, and API methods to load the available status-es from the Task doctype to populate the select for the tasks list.

This commit is contained in:
rocketdebris 2026-01-13 16:39:52 -05:00
parent adb7bc5930
commit 0c52f3fc23
4 changed files with 88 additions and 7 deletions

View file

@ -13,6 +13,23 @@ def get_job_task_list(job_id=""):
return build_error_response(str(e), 500)
@frappe.whitelist()
def get_task_status_options():
print("DEBUG: Getting task status options")
try:
task_doctype = frappe.get_doc("DocType", "Task")
status_index = 0
for i, field in enumerate(task_doctype.fields):
if field.fieldname == "status":
status_index = i
break
options = task_doctype.fields[status_index].options.split()
print("DEBUG: Task Status options retreived", options)
return build_success_response(options)
except Exception as e:
return build_error_response(str(e), 500)
@frappe.whitelist()
def get_tasks_table_data(filters={}, sortings=[], page=1, page_size=10):
"""Get paginated task table data with filtering and sorting support."""