home · contact · privacy
Improve day done tree display.
[plomtask] / plomtask / todos.py
index 775ef486440b7d3b5715ff2cf845b40bc5d36a7e..69a19c94f1e5b172dd14be0fa72fc4a4e7752fe1 100644 (file)
@@ -214,6 +214,18 @@ class Todo(BaseModel[int], ConditionsRelations):
         assert isinstance(effort_then, float)
         return effort_then
 
+    @property
+    def has_doneness_in_path(self) -> bool:
+        """Check whether self is done or has any children that are."""
+        if self.is_done:
+            return True
+        for child in self.children:
+            if child.is_done:
+                return True
+            if child.has_doneness_in_path:
+                return True
+        return False
+
     def get_step_tree(self, seen_todos: set[int]) -> TodoNode:
         """Return tree of depended-on Todos."""