From c2b099ef765942ac93d601768139ec8eca59cdc5 Mon Sep 17 00:00:00 2001 From: Julien Banken Date: Tue, 9 Mar 2021 13:53:30 +0000 Subject: [PATCH] [IMP] event: remove the dates from the urls and the default name of the events PURPOSE Previously, the url of the events contained the start and end date of the event. This link can be sent by email. If an administrator changes the start or the end date of the event, the event will still be accessible via the provided link. However, the user can be misled because the dates of the url will no longer match with those set on the event. To avoid confusion, the start and the end date will be removed from the url. SPECS - Remove the start date and the end date of the event from: (1) the urls and (2) the default name of the events. NOTE Note that URLs are backward compatible as only the ID is really used to find a record through routes. LINKS Task-2347597 COM PR odoo/odoo#69102 ENT PR odoo/enterprise#17612 X-original-commit: 60be7bb337804f2fa59003d6e5dc70ecc9750427 --- addons/event/models/event_event.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/addons/event/models/event_event.py b/addons/event/models/event_event.py index 45efd9b6436..0b1d957f7ec 100644 --- a/addons/event/models/event_event.py +++ b/addons/event/models/event_event.py @@ -480,17 +480,6 @@ class EventEvent(models.Model): if event.date_end < event.date_begin: raise ValidationError(_('The closing date cannot be earlier than the beginning date.')) - @api.depends('name', 'date_begin', 'date_end') - def name_get(self): - result = [] - for event in self: - date_begin = fields.Datetime.from_string(event.date_begin) - date_end = fields.Datetime.from_string(event.date_end) - dates = [fields.Date.to_string(fields.Datetime.context_timestamp(event, dt)) for dt in [date_begin, date_end] if dt] - dates = sorted(set(dates)) - result.append((event.id, '%s (%s)' % (event.name, ' - '.join(dates)))) - return result - @api.model def _read_group_stage_ids(self, stages, domain, order): return self.env['event.stage'].search([])