[IMP] website_event(_track)_online: improve pages and menus management
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 Improve menu generation, linked to website_event and website_event_track. Also remove frontend menu management, getting back backend management. SPECIFICATIONS: MENU GENERATION Add sequence to menus, allowing to ensure order of menus. This is done through an override of some methods, leading to a transparent modification of behavior. SPECIFICATIONS: MENU MANAGEMENT Remove front-end menu management. Keep only the global "website menu" customize option. Indeed it is quite slow and clutters the frontend management UI. Get fields back on event and event type backend views. Put them in group noone to avoid having too much fields on form view while allowing to thune them. JS and code allowing to manage through frontend is simply de-activated in this commit. That way existing use of website_event(_track) is not impacted by this commit. LINKS Community PR #53540 Enterprise PR odoo/enterprise#11384 Task ID-2252655 (Main Online Event task) Task ID-2283796 (Event B2Basics / Registration Flow) 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>
This commit is contained in:
co-authored by
Aurélien Warnon
David Beguin
parent
8d37126629
commit
96da588891
@@ -15,6 +15,7 @@
|
||||
],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/event_event_views.xml',
|
||||
'views/event_registration_views.xml',
|
||||
'views/website_visitor_views.xml',
|
||||
],
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import event_event
|
||||
from . import event_registration
|
||||
from . import website_visitor
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, _
|
||||
from odoo.addons.http_routing.models.ir_http import slug
|
||||
|
||||
|
||||
class Event(models.Model):
|
||||
_name = 'event.event'
|
||||
_inherit = 'event.event'
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# WEBSITE MENU MANAGEMENT
|
||||
# ------------------------------------------------------------
|
||||
|
||||
def _get_menu_entries(self):
|
||||
""" Deprecate old method as a new one with more information is used
|
||||
starting with website_event_online module. """
|
||||
return []
|
||||
|
||||
def _get_menu_entries_online(self):
|
||||
""" Method returning menu entries to display on the website view of the
|
||||
event, possibly depending on some options in inheriting modules.
|
||||
|
||||
Each menu entry is a tuple containing :
|
||||
* name: menu item name
|
||||
* url: if set, url to a route (do not use xml_id in that case);
|
||||
* xml_id: template linked to the page (do not use url in that case);
|
||||
* sequence: specific sequence of menu entry to be set on the menu;
|
||||
* menu_type: type of menu entry (used in inheriting modules to ease
|
||||
menu management; not used in this module in 13.3 due to technical
|
||||
limitations);
|
||||
"""
|
||||
self.ensure_one()
|
||||
return [
|
||||
(_('Introduction'), False, 'website_event.template_intro', 1, False),
|
||||
(_('Location'), False, 'website_event.template_location', 50, False),
|
||||
(_('Register'), '/event/%s/register' % slug(self), False, 100, False),
|
||||
]
|
||||
|
||||
def _update_website_menus(self, menus_update_by_field=None):
|
||||
""" Synchronize event configuration and its menu entries for frontend. """
|
||||
super(Event, self)._update_website_menus(menus_update_by_field=menus_update_by_field)
|
||||
for event in self:
|
||||
if event.website_menu and (not menus_update_by_field or event in menus_update_by_field.get('website_menu')):
|
||||
for name, url, xml_id, menu_sequence, menu_type in event._get_menu_entries_online():
|
||||
event._create_menu(menu_sequence, name, url, xml_id, menu_type=menu_type)
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo><data>
|
||||
|
||||
<record id="event_event_view_form" model="ir.ui.view">
|
||||
<field name="name">event.event.view.form.inherit.online</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[hasclass('oe_title')]" position="after">
|
||||
<div name="event_menu_configuration" groups="base.group_no_one">
|
||||
<label for="website_menu" string="Website Submenu"/>
|
||||
<field name="website_menu"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data></odoo>
|
||||
@@ -18,6 +18,7 @@
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/assets.xml',
|
||||
'views/event_event_views.xml',
|
||||
'views/event_track_templates_reminder.xml',
|
||||
'views/event_track_templates.xml',
|
||||
'views/event_track_views.xml',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import event_event
|
||||
from . import event_track_visitor
|
||||
from . import event_track
|
||||
from . import website_visitor
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, _
|
||||
from odoo.addons.http_routing.models.ir_http import slug
|
||||
|
||||
|
||||
class EventEvent(models.Model):
|
||||
_inherit = "event.event"
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# WEBSITE MENU MANAGEMENT
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# OVERRIDES: ADD SEQUENCE
|
||||
def _get_track_menu_entries(self):
|
||||
""" Remove agenda as this is now managed separately """
|
||||
self.ensure_one()
|
||||
return [
|
||||
(_('Talks'), '/event/%s/track' % slug(self), False, 10, 'track'),
|
||||
(_('Agenda'), '/event/%s/agenda' % slug(self), False, 70, 'track')
|
||||
]
|
||||
|
||||
def _get_track_proposal_menu_entries(self):
|
||||
""" See website_event_track._get_track_menu_entries() """
|
||||
self.ensure_one()
|
||||
return [(_('Talk Proposals'), '/event/%s/track_proposal' % slug(self), False, 15, 'track_proposal')]
|
||||
@@ -0,0 +1,13 @@
|
||||
odoo.define('website_event_track_online.set_customize_options', function (require) {
|
||||
"use strict";
|
||||
|
||||
var EventSpecificOptions = require('website_event.set_customize_options').EventSpecificOptions;
|
||||
|
||||
EventSpecificOptions.include({
|
||||
xmlDependencies: (EventSpecificOptions.prototype.xmlDependencies || [])
|
||||
.concat([
|
||||
'/website_event_track_online/static/src/xml/website_event_customize_options.xml',
|
||||
]),
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="website_event_track.customize_options" t-extend="website_event.customize_options">
|
||||
<t t-jquery="a[name='display-showcase-talks']" t-operation="replace">
|
||||
</t>
|
||||
<t t-jquery="a[name='allow-talk-proposal']" t-operation="replace">
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -7,6 +7,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//script[last()]" position="after">
|
||||
<script type="text/javascript" src="/website_event_track_online/static/src/js/event_track_reminder.js"></script>
|
||||
<script type="text/javascript" src="/website_event_track_online/static/src/js/website_event_customize_options.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo><data>
|
||||
|
||||
<record id="event_event_view_form" model="ir.ui.view">
|
||||
<field name="name">event.event.view.from.inherit.track.online</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="inherit_id" ref="website_event_online.event_event_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='website_menu']" position="after">
|
||||
<label for="website_track" string="Showcase Tracks"/>
|
||||
<field name="website_track"/>
|
||||
<label for="website_track_proposal" string="Allow Track Proposals"/>
|
||||
<field name="website_track_proposal"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data></odoo>
|
||||
@@ -1,6 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Set original template for tracks / track as tracking visitors -->
|
||||
<record model="ir.ui.view" id="website_event_track.tracks">
|
||||
<field name="track" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="website_event_track.track_view">
|
||||
<field name="track" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- Add wishlist button on tracks / track templates -->
|
||||
<template id="tracks_wishlist"
|
||||
name="Wishlist on Tracks"
|
||||
inherit_id="website_event_track.tracks"
|
||||
|
||||
Reference in New Issue
Block a user