I want to mark scheduled activities a project task as over if it has been moved to a different stage(stage_id).
Scheduled Activity Creation
def_timesheet_create_task(self, project):
#send notification when task is created
task = super()._timesheet_create_task(project)
fornotified_userintask.stage_id.task_create_notified_groups.users:
task.activity_schedule('mail.mail_activity_data_todo', user_id=notified_user.id)
Scheduled Activity Removal
@api.onchange("stage_id")It seems like the error is being triggered because the front-end is trying to read mail.message but fails because the mail.activity is gone due to onchange being run before it.
def_onchange_stage_id(self):
self.activity_feedback(['mail.mail_activity_data_todo']) # Completes the acitivity but Throws error.
Console output
2022-08-03 02:13:20,600 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /web/dataset/call_kw/project.task/onchange HTTP/1.1" 200 - 120 0.101 0.108
2022-08-03 02:13:20,608 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 11 0.016 7.770
2022-08-03 02:13:20,609 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 12 0.013 7.788
2022-08-03 02:13:20,610 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /longpolling/poll HTTP/1.1" 200 - 11 0.015 7.777
2022-08-03 02:13:20,625 47312 INFO odoo-dev4 werkzeug: 127.0.0.1 - - [03/Aug/2022 02:13:20] "POST /web/dataset/call_kw/mail.message/read HTTP/1.1" 200 - 5 0.010 0.006
2022-08-03 02:13:20,655 47312 WARNING odoo-dev4 odoo.http: Record does not exist or has been deleted.
(Record: mail.activity(73,), User: 2)