summaryrefslogtreecommitdiff
path: root/addons/website_event_track/controllers
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-07-14 09:41:35 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-04 14:28:29 +0000
commit2f47bcf24b5f2535f15937b5ac63b5c617d6a261 (patch)
tree3f2481175000281ab2d02b44eabe43babcdd161e /addons/website_event_track/controllers
parent64f08cc7ab123dc53f9b7bf0e8bd0cd530b74d23 (diff)
[IMP] website_event_track_online: improve track stage management + agenda based on tage
RATIONALE Events are sometimes held online, gathering a community. In this merge we improve Event application to better support full-online events with improved tracks, wishlists, chat rooms, ... PURPOSE Purpose of this commit is to be able to showcase tracks by announcing them before publishing them. People may see them before event managers encode all relevant informations and publish it. SPECIFICATIONS: ACCEPTED ON STAGE Add a is_accepted field on tracks stage model. Accepted tracks should be displayed on frontend (agenda, list view) without being available in complete view (no read access). Customers may see the track name and know what it will be about while event managers finish to encode details of the track itself. No field is added on track model for that. Using the stage itself is sufficient for what it does, aka allowing filtering in frontend. No need to add a column for that as it is not as important as published flag. SPECIFICATIONS: DONE STAGES -> PUBLISH When a track reaches a stage which "is_done" field is set, automatically publish it. It allows to manage agenda creation from backend * accepted -> display track on website for teasing purpose (agenda, track list), but not accessible to non event users; * done -> available to everyone, published; SPECIFIATIONS: AGENDA UPDATE Display accepted tracks even for customers; make them not clickable, only displayed. Manually crafting url for those tracks should still raise an error as they are not accessible. An accepted track is simply a track whose stage has is_accepted boolean flag set. LINKS Community PR #53540 Enterprise PR odoo/enterprise#11384 Task ID-2252655 (Main Online Event task) Task ID-2283796 (Event B2Basics / Registration Flow) Task ID-2299857 (Event Design Review) Task ID-2283735 (Talks -> Session upgrade) Co-Authored-By: Aurélien Warnon <awa@odoo.com> Co-Authored-By: David Beguin <dbe@odoo.com> Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Diffstat (limited to 'addons/website_event_track/controllers')
-rw-r--r--addons/website_event_track/controllers/main.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/website_event_track/controllers/main.py b/addons/website_event_track/controllers/main.py
index 0fb3d3b6989..7618ecb3998 100644
--- a/addons/website_event_track/controllers/main.py
+++ b/addons/website_event_track/controllers/main.py
@@ -80,7 +80,8 @@ class WebsiteEventTrackController(http.Controller):
event = event.with_context(tz=event.date_tz or 'UTC')
local_tz = pytz.timezone(event.date_tz or 'UTC')
days_tracks = collections.defaultdict(lambda: [])
- for track in event.track_ids.sorted(lambda track: (bool(track.date), track.date, bool(track.location_id))):
+ event_track_ids = self._event_agenda_get_tracks(event)
+ for track in event_track_ids.sorted(lambda track: (bool(track.date), track.date, bool(track.location_id))):
if not track.date:
continue
date = fields.Datetime.from_string(track.date).replace(tzinfo=pytz.utc).astimezone(local_tz)
@@ -97,9 +98,13 @@ class WebsiteEventTrackController(http.Controller):
'main_object': event,
'days': days,
'tracks_by_days': tracks_by_days,
- 'tag': tag
+ 'tag': tag,
+ 'user_event_manager': request.env.user.has_group('event.group_event_manager'),
})
+ def _event_agenda_get_tracks(self, event):
+ return event.track_ids
+
@http.route([
'''/event/<model("event.event"):event>/track''',
'''/event/<model("event.event"):event>/track/tag/<model("event.track.tag"):tag>'''