diff --git a/organize/work.py b/organize/work.py index 6f51dbf..d5c0be8 100644 --- a/organize/work.py +++ b/organize/work.py @@ -177,6 +177,10 @@ class WorkItem(Stateful, Track): for k in self.initAttributes: v = kw.get(k, _not_found) if v is _not_found: + if action == 'start' and k in ('end',): + continue + if action in ('stop', 'finish') and k in ('duration', 'effort',): + continue v = self.data.get(k) if v is not None: newData[k] = v diff --git a/organize/work.txt b/organize/work.txt index d2169ef..5b2ba02 100644 --- a/organize/work.txt +++ b/organize/work.txt @@ -98,8 +98,7 @@ but may also be specified explicitly. >>> wi03 = wi02.doAction('start', start=1229958000) >>> wi03 + {'duration': 700, 'start': 1229958000, 'created': ..., 'creator': 'jim'}> Stopping and finishing work --------------------------- @@ -110,8 +109,15 @@ continue work later, so he executes a ``stop`` action. >>> wi04 = wi03.doAction('stop', end=1229958300) >>> wi04 + {'start': 1229958000, 'created': ..., 'end': 1229958300, 'creator': 'jim'}> + +After another hour Jim works again on the task; he now finishes it within +ten minutes and records this in one step. + + >>> wi05 = wi04.doAction('finish', start=1229961600, end=1229967200) + >>> wi05 + Closing work ------------ @@ -119,7 +125,7 @@ Closing work Let's now check how many work items have been generated. >>> len(list(workItems)) - 4 + 5 Delegation of Work Items