diff --git a/organize/README.txt b/organize/README.txt index 0e179ab..c6bb8c2 100644 --- a/organize/README.txt +++ b/organize/README.txt @@ -129,8 +129,8 @@ the work item is not in the ``assigned`` state. >>> wi01.userName 'jim' -Change work item states ------------------------ +Change work item state +---------------------- Now Jim accepts the work item, i.e. he wants to work on it. Now the party that the work item is assigned to may not be changed any more. @@ -153,6 +153,9 @@ but may also be specified explicitly. 'assigned': ..., 'planDuration': 600, 'planStart': 1229955772, 'creator': 'john', 'planEffort': 600}> +Stopping work +------------- + After five minutes of work Jim decides to stop working; but he will continue work later, so he executes a ``continue`` transition that will set up a copy of the work item. @@ -161,9 +164,13 @@ He also specifies a new plan start and duration for the new work item. Plan end and plan effort are given explicitly as None values so that they won't be taken from the old work item but recalculated. +Note that the work item has already been set to assigned as Jim has +committed himself to continue working on it by selecting the ``continue`` +transition. + >>> wi02 = wi01.stopWork('continue', end=1229958300, planStart=1229960000, ... planDuration=400, planEnd=None, planEffort=None) >>> wi02 - diff --git a/organize/work.py b/organize/work.py index b771d8d..b87701c 100644 --- a/organize/work.py +++ b/organize/work.py @@ -166,7 +166,10 @@ class WorkItemTrack(WorkItem, Track): if transition == 'transfer' and 'party' not in newData: raise ValueError("Property 'party' must be set when transferring.") workItems = IWorkItems(getParent(self)) - return workItems.add(self.taskId, self.userName, self.runId, **newData) + new = workItems.add(self.taskId, self.userName, self.runId, **newData) + if transition == 'continue': + new.assign() + return new def reindex(self): getParent(self).updateTrack(self, {}) # force reindex