summaryrefslogtreecommitdiff
path: root/addons/website_event_track/tests
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-08-18 13:56:08 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-21 17:30:13 +0000
commit77d7a3cf6a2cf07e18804a2d9b59e3697b11006e (patch)
tree435ca546a4b8eb5867dcd756e940b14e67513479 /addons/website_event_track/tests
parent8da7288453d43ff6ccfd6cb6d8332eec998d3927 (diff)
[MOV] website_event(_track): move website event menu into website event
PURPOSE Clean organization and models linked to Event Online feature introduced in semi stable saas-13.3 at odoo/odoo@981f95bbf46658eda9f2d33751b9310cc67d86aa and odoo/enterprise@14722028ae0773c3710ea48ce48ff44703e83b5a 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 website event menu model directly into website event. Website event menu model has been introduced to help dealing with event-specific menus and website menus. This is some kind of glue to synchronize both of them as people could either * update an event (website_menu, website_track) that updates website menus availability; * update menus through website that should update event field value and menu computation; Having a model introduced in website event track forces to have override and code split across website_event, website_event_track, and now also in both _online version of those two as menu management was improved. In this commit we simplify all this code by moving most of menu management code in website_event, leaving only business-specific code (fields and their menus) to sub modules. SPECIFICATIONS: WEBSITE EVENT MENU Make type required as we don't support entries without type. Indeed this model is used to automate menus generation / destruction, and not for hand-made menus. We therefore set type as required and add a cascade ondelete for selection. SPECIFCIATIONS: COMMUNITY MENU Doing this change allows to define community menu in website_event and re-use it in website_event_meet and website_event_track_quiz, removing some unnecessary dependencies. This menu is void in website_event, and displays either meeting rooms (in meet) or quiz points leaderboard (in quiz), or a mix of both if the two features are installed. LINKS Task ID-2319779 COM odoo/odoo#56067 ENT odoo/enterprise#12520 UPG odoo/upgrade#165
Diffstat (limited to 'addons/website_event_track/tests')
-rw-r--r--addons/website_event_track/tests/test_website_event.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/addons/website_event_track/tests/test_website_event.py b/addons/website_event_track/tests/test_website_event.py
index bf6a2bd6965..1fedaf2d428 100644
--- a/addons/website_event_track/tests/test_website_event.py
+++ b/addons/website_event_track/tests/test_website_event.py
@@ -11,7 +11,7 @@ from odoo.tests.common import users
class TestEventWebsiteTrack(TestWebsiteEventCommon):
def _get_menus(self):
- return super(TestEventWebsiteTrack, self)._get_menus() | set(['Talks', 'Agenda', 'Talk Proposals'])
+ return super(TestEventWebsiteTrack, self)._get_menus() | set(['Community', 'Talks', 'Agenda', 'Talk Proposals'])
@users('user_eventmanager')
def test_create_menu(self):
@@ -24,6 +24,7 @@ class TestEventWebsiteTrack(TestWebsiteEventCommon):
'name': 'test_reg',
})],
'website_menu': True,
+ 'community_menu': True,
'website_track': True,
'website_track_proposal': True,
})
@@ -37,6 +38,7 @@ class TestEventWebsiteTrack(TestWebsiteEventCommon):
'date_begin': fields.Datetime.to_string(datetime.today() + timedelta(days=1)),
'date_end': fields.Datetime.to_string(datetime.today() + timedelta(days=15)),
'website_menu': True,
+ 'community_menu': True,
'website_track': True,
'website_track_proposal': True,
})
@@ -46,7 +48,7 @@ class TestEventWebsiteTrack(TestWebsiteEventCommon):
introduction_menu = event.menu_id.child_id.filtered(lambda menu: menu.name == 'Introduction')
introduction_menu.unlink()
- self._assert_website_menus(event, set(['Location', 'Register', 'Talks', 'Agenda', 'Talk Proposals']))
+ self._assert_website_menus(event, set(['Location', 'Register', 'Community', 'Talks', 'Agenda', 'Talk Proposals']))
menus = event.menu_id.child_id.filtered(lambda menu: menu.name in ['Agenda', 'Talk Proposals'])
menus.unlink()
@@ -58,12 +60,12 @@ class TestEventWebsiteTrack(TestWebsiteEventCommon):
self.assertFalse(event.website_track)
self.assertFalse(event.website_track_proposal)
- self._assert_website_menus(event, set(['Location', 'Register']))
+ self._assert_website_menus(event, set(['Location', 'Register', 'Community']))
event.write({'website_track_proposal': True})
self.assertTrue(event.website_track)
self.assertTrue(event.website_track_proposal)
- self._assert_website_menus(event, set(['Location', 'Register', 'Talks', 'Agenda', 'Talk Proposals']))
+ self._assert_website_menus(event, set(['Location', 'Register', 'Community', 'Talks', 'Agenda', 'Talk Proposals']))
@users('user_eventmanager')
def test_write_menu(self):
@@ -71,6 +73,7 @@ class TestEventWebsiteTrack(TestWebsiteEventCommon):
self.assertFalse(event.menu_id)
event.write({
'website_menu': True,
+ 'community_menu': True,
'website_track': True,
'website_track_proposal': True,
})