[FIX] calendar: event of done activity must not be deleted

To reproduce
============
- Create a meeting activity from any document (for example CRM opportunity) with a calendar.
- It will create a meeting in the calendar.
- Now, mark as done the activity created and it will delete the meeting from the calendar too.

revert of https://github.com/odoo/odoo/pull/144526

opw-3626773

closes odoo/odoo#146421

X-original-commit: 0b183299a8ef7361d28d9d2b49cc56b74bfb2b46
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
This commit is contained in:
Abdelouahab (abla)
2023-12-15 08:44:23 +00:00
parent 44a628ba35
commit 8be8230512
2 changed files with 4 additions and 4 deletions
+1 -4
View File
@@ -39,10 +39,7 @@ class MailActivity(models.Model):
return super(MailActivity, self)._action_done(feedback=feedback, attachment_ids=attachment_ids)
def unlink_w_meeting(self):
return self.unlink()
def unlink(self):
events = self.mapped('calendar_event_id')
res = super().unlink()
res = self.unlink()
events.unlink()
return res
@@ -77,3 +77,6 @@ class TestMailActivityMixin(MailCommon):
self.assertEqual(test_record.activity_calendar_event_id.name, ev1.name, "This should be the calendar event of the next activity")
act1._action_done(feedback="Mark activity as done with text")
self.assertFalse(act1.exists(), "activity marked as done should be deleted")
self.assertTrue(ev1.exists(), "event of done activity must not be deleted")