[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:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user