PURPOSE Clean organization and models linked to Event Online feature introduced in semi stable saas-13.3 at odoo/odoo@981f95bbf4 and odoo/enterprise@14722028ae Also clean website event menu not being available in website event but only in website event track, which implies some extra-code to manage it. In short: merge website_event_online in website_event, website_event_track _(online/session) in website_event_track. RATIONALE _online modules have been added to extend content of website_event and website_event_track without having any impact on those module. First step of cleaning is to move this content directly in base module. track_session module is mainly a rewrite of track module. Second step of cleaning is to move its content directly in website_event_track. SPECIFICATIONS Move all content of website event track session to website event tracK. It was mainly of rewriting of views and can now be safely merged into the base track module. Update dependencies accordingly. LINKS Task ID-2319779 COM odoo/odoo#56067 ENT odoo/enterprise#12520 UPG odoo/upgrade#1654
22 lines
984 B
Python
22 lines
984 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
import re
|
|
|
|
from odoo.addons.website_event_track.controllers.event_track import EventTrackController
|
|
from odoo.http import request
|
|
|
|
|
|
class WebsiteEventSessionLiveController(EventTrackController):
|
|
|
|
def _event_track_page_get_values(self, event, track, **options):
|
|
if 'widescreen' not in options:
|
|
options['widescreen'] = bool(track.youtube_video_url)
|
|
values = super(WebsiteEventSessionLiveController, self)._event_track_page_get_values(event, track, **options)
|
|
# Youtube disables the chat embed on all mobile devices
|
|
# This regex is a naive attempt at matching their behavior (should work for most cases)
|
|
values['is_mobile_chat_disabled'] = bool(re.match(
|
|
r'^.*(Android|iPad|iPhone).*',
|
|
request.httprequest.headers.get('User-Agent', request.httprequest.headers.get('user-agent', ''))))
|
|
return values
|