-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Describe the bug
I have a chore with 5 tasks. I built a new task list with only 4 items (removing item #1). I tried to update the chore with this new task list. the updated chore contains tasks 1 2 3 4 instead of 2 3 4 5.
Bypass : I tried deleting the chore then recreating, works fine.
To Reproduce
Code excerpt:
chore = tm1.chores.get( sChore )
lTask = chore.tasks
lUpdatedTask = [t for t in lTask if t.process_name != sProcess]
print( f'original: len={len( lTask )} - {lTask}\n\n' )
print( f'updated: len={len( lUpdatedTask )} - {lUpdatedTask}\n\n' )
if len( chore.tasks ) != len( lUpdatedTask ):
tm1.chores.update( sChore )
Bypass code:
chore.tasks = lUpdatedTask
tm1.chores.delete( sChore )
tm1.chores.create( chore )
Expected behavior
Task list should be updated
Version
TM1py 2.1
TM1 Server Version: 11.8.02800.9
Additional context
I checked the code in ChoreService.py. Looks like the "update" algorithm might need to be reviewed. I'll give it a look if I get time...