This question has been flagged
1 Reply
5118 Views

I've created a rule to add activities when a task reaches a certain stage, which works perfectly.  But now there are too many activities on already completed tasks. 

It would be good to be able to have an action that will allow the removal of any open activities, so we could keep the Activities clean with things that are actually open, and not have to go manually to everything to close them out which is time consuming. 

Anybody know how to accomplish this?  Thank you in advance. 

Avatar
Discard
Best Answer

Hi,

Please see the sample in the below image, you can execute this scheduled action once using run manually and remove it.



Code:

activities = env['mail.activity'].search([])
for activity in activities:
activity.unlink()

Thanks

Avatar
Discard