def METHOD_NAME(doctype, name):
	assignments = frappe.get_all(
		"ToDo",
		fields=["allocated_to", "name"],
		filters=dict(reference_type=doctype, reference_name=name, status=("!=", "Cancelled")),
	)
	if not assignments:
		return False
	for assign_to in assignments:
		set_status(doctype, name, todo=assign_to.name, assign_to=assign_to.allocated_to, status="Closed")
	return True