[IMP] calendar: delete recurrent event

This PR change the delete button in the attendee calendar if the
event is recurrent.
If the event is recurrent, a wizard pop up to ask if you
wish to remove :
- The selected event
- The selected event and the following
- All the event in the recurrence

task-id : 3148011

closes odoo/odoo#113024

Signed-off-by: Arnaud Joset <arj@odoo.com>
This commit is contained in:
Florian Damhaut
2023-03-09 15:54:47 +01:00
parent bd0a6f9667
commit f00919461e
7 changed files with 87 additions and 4 deletions
+21 -2
View File
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import UserError
import pytz
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from odoo.tests.common import TransactionCase
from odoo.tests.common import TransactionCase, Form
class TestRecurrentEvents(TransactionCase):
@@ -580,6 +579,26 @@ class TestUpdateRecurrentEvents(TestRecurrentEvents):
self.assertTrue(self.recurrence)
self.assertEqual(self.events.exists(), self.events[0])
def test_unlink_recurrence_wizard_next(self):
event = self.events[1]
wizard = self.env['calendar.popover.delete.wizard'].create({'record': event.id})
form = Form(wizard)
form.delete = 'next'
form.save()
wizard.close()
self.assertTrue(self.recurrence)
self.assertEqual(self.events.exists(), self.events[0])
def test_unlink_recurrence_wizard_all(self):
event = self.events[1]
wizard = self.env['calendar.popover.delete.wizard'].create({'record': event.id})
form = Form(wizard)
form.delete = 'all'
form.save()
wizard.close()
self.assertFalse(self.recurrence.exists())
self.assertFalse(self.events.exists())
class TestUpdateMultiDayWeeklyRecurrentEvents(TestRecurrentEvents):