diff options
| author | Thibault Delavallée <tde@odoo.com> | 2020-08-21 13:34:37 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-08-21 17:30:13 +0000 |
| commit | 4bbb36bd7fbd4e4371e860b36a9eb2ce9b4eaf1f (patch) | |
| tree | 7366dc933315a88db6aefcd6a1286194dbb27476 /addons/website_event/models/event_event.py | |
| parent | de8a5652b27da2f659b1378831c6d712ff40b488 (diff) | |
[IMP] (website_)event: ease configuration of Online features
PURPOSE
Clean organization and models linked to Event Online feature introduced in
semi stable saas-13.3 at odoo/odoo@981f95b and odoo/enterprise@1472202
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
Allow to configure Menu CTA button on event from event_type, like other
frontend related menus and buttons.
Add settings to ease discovering and installing sub event features like
* meet;
* exhibitor;
* live mode;
* quizzes;
LINKS
Task ID-2319779
COM odoo/odoo#56067
ENT odoo/enterprise#12520
UPG odoo/upgrade#1654
Diffstat (limited to 'addons/website_event/models/event_event.py')
| -rw-r--r-- | addons/website_event/models/event_event.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/website_event/models/event_event.py b/addons/website_event/models/event_event.py index 162cdf8cd55..72f8096b5a1 100644 --- a/addons/website_event/models/event_event.py +++ b/addons/website_event/models/event_event.py @@ -123,10 +123,16 @@ class Event(models.Model): elif not event.website_menu: event.community_menu = False - @api.depends('website_menu') + @api.depends("event_type_id", "website_menu") def _compute_menu_register_cta(self): + """ At type onchange: synchronize. At website_menu update: synchronize. """ for event in self: - event.menu_register_cta = event.website_menu + if event.event_type_id and event.event_type_id != event._origin.event_type_id: + event.menu_register_cta = event.event_type_id.menu_register_cta + elif event.website_menu and event.website_menu != event._origin.website_menu or not event.menu_register_cta: + event.menu_register_cta = True + elif not event.website_menu: + event.menu_register_cta = False @api.depends('date_begin', 'date_end') def _compute_time_data(self): |
