When I tried to mark a task with prerequisites as active, the task status would revert to inactive after closing and reopening Task Coach. I found that when adding or removing a prerequisite, the actual start date of the task is set to the maximum future time, which seems wrong. I have been testing with the patch below, and it seems to have fixed it.
Thanks,
Brian
Do not change actual start dates when adding or removing a prerequisite
diff -r def65838fada -r 05f542c3521a taskcoach/taskcoachlib/domain/task/task.py
--- a/taskcoach/taskcoachlib/domain/task/task.py Fri Mar 08 14:37:20 2019 -0600
+++ b/taskcoach/taskcoachlib/domain/task/task.py Wed Mar 13 13:05:12 2019 -0500
@@ -1224,7 +1224,6 @@
if prerequisites == self.prerequisites():
return
self.prerequisites = WeakSet(prerequisites)
- self.setActualStartDateTime(self.maxDateTime, recursive=True)
self.recomputeAppearance(recursive=True)
pub.sendMessage(self.prerequisitesChangedEventType(),
newValue=self.prerequisites(), sender=self)
@@ -1234,7 +1233,6 @@
if prerequisites <= self.prerequisites():
return
self.prerequisites = WeakSet(prerequisites | self.prerequisites())
- self.setActualStartDateTime(self.maxDateTime, recursive=True)
self.recomputeAppearance(recursive=True)
pub.sendMessage(self.prerequisitesChangedEventType(),
newValue=self.prerequisites(), sender=self)
At some level, tasks with unfinished prereqs shouldn't be doable, but I agree that the behavior you describe seems weird.
Currently, the standard use of prereqs is via hiding inactive tasks and setting a planned start time for the task in question. It would show up as "late" if not for the prereqs being unfinished. Thus, it doesn't show as late until the prereqs are completed or deleted.
While it could make sense to not allow an actual start for a task with unfinished prereqs, it also makes sense to let users override by manually adding / keeping the actual start date.
Ideally, there would be some other interaction that indicates the existence of prereqs for an "active" task (one with an actual start date)… we could get into discussing how that should/could work some day after getting the frameworks updated and other higher priority updates.
Personally, I'm okay with the fix you propose (but can't myself do a code review of it).