Reopen completed Task

Hello Dears

Actually in task doctype if one of our engineers has completed the task and the task has a new update or edit it cannot change task status if it has marked as completed

So they cant trace the old tasks

so any solutions here !!

@Mahmoud_Ghoneem

You can assign the task to that person or you can add a comment to get that person notified.

Ok no problem with notifications

But actually the single engineer working with more than 20 task weekly so they always filter with not completed tasks

now they notified but they also forget the task coz its not in the list :slight_smile:

and i think to separate them into task doctype for not completed tasks and todo doctype for edited completed task will not be useful

the point is why we cant reopen the task ??? like Issues !!!

also after adding customscript

frm.add_custom_button("Reopen", function() {
 ` frm.set_value("status", "Open");`
  `frm.set_value("workflow_state", "Created");`
 ` frm.save();`
`})`

it doesnt matter :slight_smile: it save with completed again

any updates ?? or should i open an issue

An issue will seem to suggest it is broken.

If you feel others could benefit from this as a feature, post a feature request.

same problem

I’d say it’s broken. I found this code in task.py

	def validate_progress(self):
..
..
	if self.progress == 100:
		self.status = 'Completed'

	if self.status == 'Completed':
		self.progress = 100

So after you change a task to “Completed”, the progress changes to 100%.
If you want to change it back to “Open”, the progress is still 100%, so this code changes it back to “Completed”.

So it seems that if you want to reopen the task, you’d have to change the status to “Open” and change the progress to less than 100

So @Mahmoud_Ghoneem your code would work as intendend if you also change the progress:

frm.add_custom_button("Reopen", function() {
    frm.set_value("status", "Open");
    frm.set_value("progress", 0);
    frm.set_value("workflow_state", "Created");
    frm.save();
})
2 Likes