[IMP] (website_)event(_track): change event form view display
PURPOSE Change the event form view to improve its usability and make it clearer. SPECIFICATIONS - Change some stats buttons icons - Change order of the fields and put the range date field in second place since it's a mandatory field. LINKS Task ID : 2198660 PR : #46659
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
<!-- Event Categories -->
|
||||
<record id="event_type_data_online" model="event.type">
|
||||
<field name="name">Online</field>
|
||||
<field name="is_online" eval="True"/>
|
||||
<field name="auto_confirm" eval="True"/>
|
||||
<field name="use_mail_schedule" eval="False"/>
|
||||
</record>
|
||||
|
||||
@@ -44,8 +44,6 @@ class EventType(models.Model):
|
||||
help="Events and registrations will automatically be confirmed "
|
||||
"upon creation, easing the flow for simple events.")
|
||||
# location
|
||||
is_online = fields.Boolean(
|
||||
'Online Event', help='Online events like webinars do not require a specific location and are hosted online.')
|
||||
use_timezone = fields.Boolean('Use Default Timezone')
|
||||
default_timezone = fields.Selection(
|
||||
_tz_get, string='Timezone', default=lambda self: self.env.user.tz or 'UTC')
|
||||
@@ -162,8 +160,9 @@ class EventEvent(models.Model):
|
||||
compute_sudo=True, readonly=True, compute='_compute_seats')
|
||||
# Registration fields
|
||||
auto_confirm = fields.Boolean(
|
||||
string='Autoconfirm Registrations',
|
||||
compute='_compute_from_event_type', copy=True, readonly=False, store=True)
|
||||
string='Autoconfirmation',
|
||||
compute='_compute_from_event_type', copy=True, readonly=False, store=True,
|
||||
help = 'Autoconfirm Registrations. Registrations will automatically be confirmed upon creation.')
|
||||
registration_ids = fields.One2many('event.registration', 'event_id', string='Attendees')
|
||||
event_registrations_open = fields.Boolean('Registration open', compute='_compute_event_registrations_open')
|
||||
event_ticket_ids = fields.One2many(
|
||||
@@ -181,13 +180,9 @@ class EventEvent(models.Model):
|
||||
is_one_day = fields.Boolean(compute='_compute_field_is_one_day')
|
||||
start_sale_date = fields.Date('Start sale date', compute='_compute_start_sale_date')
|
||||
# Location and communication
|
||||
is_online = fields.Boolean(
|
||||
string='Online Event', compute='_compute_from_event_type',
|
||||
copy=True, readonly=False, store=True)
|
||||
address_id = fields.Many2one(
|
||||
'res.partner', string='Venue', compute='_compute_address_id',
|
||||
copy=True, readonly=False, store=True, tracking=True,
|
||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
'res.partner', string='Venue', default=lambda self: self.env.company.partner_id.id,
|
||||
tracking=True, domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
country_id = fields.Many2one(
|
||||
'res.country', 'Country', related='address_id.country_id',
|
||||
copy=True, readonly=False, store=True)
|
||||
@@ -302,14 +297,6 @@ class EventEvent(models.Model):
|
||||
start_dates = [ticket.start_sale_date for ticket in event.event_ticket_ids if ticket.start_sale_date]
|
||||
event.start_sale_date = min(start_dates) if start_dates else False
|
||||
|
||||
@api.depends('is_online')
|
||||
def _compute_address_id(self):
|
||||
for event in self:
|
||||
if event.is_online:
|
||||
event.address_id = False
|
||||
elif not event.address_id:
|
||||
event.address_id = self.env.company.partner_id.id
|
||||
|
||||
@api.depends('event_type_id')
|
||||
def _compute_date_tz(self):
|
||||
for event in self:
|
||||
|
||||
@@ -51,7 +51,6 @@ class TestEventCommon(common.SavepointCase):
|
||||
cls.event_type_complex = cls.env['event.type'].create({
|
||||
'name': 'Update Type',
|
||||
'auto_confirm': True,
|
||||
'is_online': False,
|
||||
'has_seats_limitation': True,
|
||||
'seats_max': 30,
|
||||
'use_timezone': True,
|
||||
|
||||
@@ -59,7 +59,6 @@ class TestEventData(TestEventCommon):
|
||||
'date_end': FieldsDatetime.to_string(datetime.today() + timedelta(days=15)),
|
||||
})
|
||||
|
||||
self.assertFalse(event.is_online)
|
||||
self.assertEqual(event.address_id, self.env.user.company_id.partner_id)
|
||||
# seats: coming from event type configuration
|
||||
self.assertEqual(event.seats_availability, 'limited')
|
||||
@@ -69,11 +68,6 @@ class TestEventData(TestEventCommon):
|
||||
self.assertEqual(event.seats_used, 0)
|
||||
self.assertEqual(event.seats_expected, 0)
|
||||
|
||||
# set is_online: should reset the address_id field
|
||||
event.update({'is_online': True})
|
||||
self.assertTrue(event.is_online)
|
||||
self.assertFalse(event.address_id)
|
||||
|
||||
# create registration in order to check the seats computation
|
||||
self.assertTrue(event.auto_confirm)
|
||||
for x in range(5):
|
||||
@@ -117,12 +111,10 @@ class TestEventData(TestEventCommon):
|
||||
'name': 'Event Update Type',
|
||||
'date_begin': FieldsDatetime.to_string(datetime.today() + timedelta(days=1)),
|
||||
'date_end': FieldsDatetime.to_string(datetime.today() + timedelta(days=15)),
|
||||
'is_online': True,
|
||||
})
|
||||
self.assertEqual(event.date_tz, self.env.user.tz)
|
||||
self.assertEqual(event.seats_availability, 'unlimited')
|
||||
self.assertFalse(event.auto_confirm)
|
||||
self.assertTrue(event.is_online)
|
||||
self.assertEqual(event.event_mail_ids, self.env['event.mail'])
|
||||
|
||||
event_type.write({
|
||||
@@ -136,7 +128,6 @@ class TestEventData(TestEventCommon):
|
||||
self.assertEqual(event.seats_availability, 'limited')
|
||||
self.assertEqual(event.seats_max, event_type.seats_max)
|
||||
self.assertTrue(event.auto_confirm)
|
||||
self.assertFalse(event.is_online)
|
||||
self.assertEqual(event.event_mail_ids.interval_nbr, 1)
|
||||
self.assertEqual(event.event_mail_ids.interval_unit, 'days')
|
||||
self.assertEqual(event.event_mail_ids.interval_type, 'before_event')
|
||||
|
||||
@@ -15,20 +15,6 @@
|
||||
</div>
|
||||
<h2>Location</h2>
|
||||
<div class="row mt16 o_settings_container" name="event_type_location">
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="is_online"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="is_online"/>
|
||||
<div class="row">
|
||||
<div class="col-lg-8 mt16 text-muted">
|
||||
Online events like webinars do not require a specific location
|
||||
and are hosted online.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="use_timezone"/>
|
||||
@@ -148,7 +134,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Event Templates">
|
||||
<field name="name"/>
|
||||
<filter string="Online Event" name="online_event" help="Online Event" domain="[('is_online', '=', True)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -215,26 +200,10 @@
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only" string="Event Name"/>
|
||||
<h1><field name="name" placeholder="e.g. Conference for Architects"/></h1>
|
||||
<field name="is_online" groups="base.group_no_one"/>
|
||||
<label for="is_online" string="Online" groups="base.group_no_one"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="organizer_id"/>
|
||||
<field name="address_id"
|
||||
attrs="{'invisible': [('is_online', '=', True)]}"
|
||||
context="{'show_address': 1}"
|
||||
options='{"always_reload": True}'/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="user_id" domain="[('share', '=', False)]"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="event_type_id" options="{'no_create':True}"/>
|
||||
<field name="tag_ids" widget="many2many_tags" options="{'no_quick_create': True}"/>
|
||||
<field name="auto_confirm" groups="base.group_no_one"/>
|
||||
</group>
|
||||
<group>
|
||||
<label for="date_begin" string="Date"/>
|
||||
<div class="o_row">
|
||||
<field name="date_begin" widget="daterange" nolabel="1" class="oe_inline" options="{'related_end_date': 'date_end'}"/>
|
||||
@@ -242,6 +211,17 @@
|
||||
<field name="date_end" widget="daterange" nolabel="1" class="oe_inline" options="{'related_start_date': 'date_begin'}"/>
|
||||
</div>
|
||||
<field name="date_tz"/>
|
||||
<field name="organizer_id"/>
|
||||
<field name="user_id" domain="[('share', '=', False)]"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="event_type_id" string="Template" options="{'no_create':True}"/>
|
||||
<field name="tag_ids" widget="many2many_tags" options="{'no_quick_create': True}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="address_id"
|
||||
context="{'show_address': 1}"
|
||||
options='{"always_reload": True}'/>
|
||||
<field name="auto_confirm"/>
|
||||
</group>
|
||||
<group>
|
||||
<label for="seats_availability"/>
|
||||
@@ -253,9 +233,6 @@
|
||||
<field name="seats_max" attrs="{'invisible': [('seats_availability', '=', 'unlimited')], 'required': [('seats_availability', '=', 'limited')]}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group class="w-100">
|
||||
<field name="note" placeholder="Add a note..." nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Tickets" name="tickets">
|
||||
@@ -278,10 +255,8 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description" name="event_description">
|
||||
<group>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<page string="Notes" name="event_notes">
|
||||
<field name="note" placeholder="Add a note..."/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -436,7 +411,6 @@
|
||||
<separator/>
|
||||
<filter string="Upcoming/Running" name="upcoming"
|
||||
domain="[('date_end', '>=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" help="Upcoming events from today" />
|
||||
<filter string="Online Events" name="online_events" help="Online Events" domain="[('is_online', '=', True)]"/>
|
||||
<separator/>
|
||||
<filter string="Start Date" name="start_date" date="date_begin"/>
|
||||
<separator/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<record id="event_event_view_form_inherit_mass_mailing_track" model="ir.ui.view">
|
||||
<field name="name">event.event.view.form.inherit.mass.mailing.track</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="priority" eval="25"/>
|
||||
<field name="priority" eval="4"/>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='stage_id']" position="before">
|
||||
|
||||
@@ -100,11 +100,9 @@ class WebsiteEventController(http.Controller):
|
||||
current_type = EventType.browse(int(searches['type']))
|
||||
domain_search["type"] = [("event_type_id", "=", int(searches["type"]))]
|
||||
|
||||
if searches["country"] != 'all' and searches["country"] != 'online':
|
||||
if searches["country"] != 'all':
|
||||
current_country = request.env['res.country'].browse(int(searches['country']))
|
||||
domain_search["country"] = ['|', ("country_id", "=", int(searches["country"])), ("country_id", "=", False)]
|
||||
elif searches["country"] == 'online':
|
||||
domain_search["country"] = [("country_id", "=", False)]
|
||||
|
||||
def dom_without(without):
|
||||
domain = []
|
||||
@@ -140,8 +138,6 @@ class WebsiteEventController(http.Controller):
|
||||
order = 'date_begin'
|
||||
if searches.get('date', 'all') == 'old':
|
||||
order = 'date_begin desc'
|
||||
if searches["country"] != 'all': # if we are looking for a specific country
|
||||
order = 'is_online, ' + order # show physical events first
|
||||
order = 'is_published desc, ' + order
|
||||
events = Event.search(dom_without("none"), limit=step, offset=pager['offset'], order=order)
|
||||
|
||||
|
||||
@@ -213,7 +213,6 @@
|
||||
<!-- Title -->
|
||||
<h5 t-attf-class="card-title mt-2 mb-0 text-truncate #{(not event.website_published) and 'text-danger'}">
|
||||
<span t-field="event.name" itemprop="name"/>
|
||||
<div class="badge badge-pill badge-info ml-2 mt-2 pt4 pb4" t-if="event.is_online">Online</div>
|
||||
</h5>
|
||||
<!-- Start Date & Time -->
|
||||
<time itemprop="startDate" t-att-datetime="event.date_begin">
|
||||
@@ -225,8 +224,7 @@
|
||||
<small class="text-muted text-truncate">Organizer: <span t-field="event.organizer_id" itemprop="organizer"/></small>
|
||||
</div>
|
||||
<!-- Location -->
|
||||
<div t-if="not event.is_online" itemprop="location" t-field="event.address_id" t-options="{'widget': 'contact', 'fields': ['city'], 'no_marker': 'true'}"/>
|
||||
<div t-else="" class="invisible">online</div>
|
||||
<div itemprop="location" t-field="event.address_id" t-options="{'widget': 'contact', 'fields': ['city'], 'no_marker': 'true'}"/>
|
||||
<div class="mt8 d-flex align-items-center">
|
||||
<t t-foreach="event.tag_ids" t-as="tag">
|
||||
<span t-attf-class="badge mr8 #{'badge-primary' if tag in search_tags else 'badge-light'}">
|
||||
@@ -466,31 +464,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Location -->
|
||||
<t t-if="not event.is_online">
|
||||
<div t-if="event.address_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Location</h6>
|
||||
<h4 t-field="event.address_id" class="" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name"]
|
||||
}'/>
|
||||
<div itemprop="location" class="mb-2" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address"],
|
||||
"no_marker": True
|
||||
}'/>
|
||||
<div class="mb-3" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["phone", "mobile", "email"]
|
||||
}'/>
|
||||
<i class="fa fa-map-marker fa-fw" role="img"/>
|
||||
<a t-att-href="event.google_map_link()" target="_blank">Get the direction</a>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Online Event</h6>
|
||||
</div>
|
||||
</t>
|
||||
<div t-if="event.address_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Location</h6>
|
||||
<h4 t-field="event.address_id" class="" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["name"]
|
||||
}'/>
|
||||
<div itemprop="location" class="mb-2" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["address"],
|
||||
"no_marker": True
|
||||
}'/>
|
||||
<div class="mb-3" t-field="event.address_id" t-options='{
|
||||
"widget": "contact",
|
||||
"fields": ["phone", "mobile", "email"]
|
||||
}'/>
|
||||
<i class="fa fa-map-marker fa-fw" role="img"/>
|
||||
<a t-att-href="event.google_map_link()" target="_blank">Get the direction</a>
|
||||
</div>
|
||||
<!-- Organizer -->
|
||||
<div t-if="event.organizer_id" class="o_wevent_sidebar_block">
|
||||
<h6 class="o_wevent_sidebar_title">Organizer</h6>
|
||||
|
||||
@@ -31,17 +31,13 @@
|
||||
<field name="priority" eval="5"/>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="organizer_id" position="before">
|
||||
<field name="company_id" position="after">
|
||||
<field name="website_id" options="{'no_create': True}" domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" groups="website.group_multi_website"/>
|
||||
</field>
|
||||
<div name="button_box" position="inside">
|
||||
<field name="website_url" invisible="1"/>
|
||||
<field name="is_published" widget="website_redirect_button"/>
|
||||
</div>
|
||||
<label for="is_online" position="after">
|
||||
<field name="website_menu"/>
|
||||
<label for="website_menu" string="Website Menu"/>
|
||||
</label>
|
||||
<xpath expr="//field[@name='stage_id']" position="before">
|
||||
<button name="action_open_badge_editor"
|
||||
type="object"
|
||||
@@ -57,7 +53,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="website_id" groups="website.group_multi_website" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" optional="show"/>
|
||||
<field name="is_online" string="Is Online" optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<field name="inherit_id" ref="website_event.event_event_view_form_inherit_website"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page name="event_notes" position="before">
|
||||
<page string="Questions" name="questions">
|
||||
<field name="question_ids" nolabel="1">
|
||||
<tree>
|
||||
@@ -71,7 +71,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</page>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -20,30 +20,25 @@
|
||||
<!-- Events Organisation/CONFIGURATION/EVENTS -->
|
||||
<record id="view_event_form" model="ir.ui.view">
|
||||
<field name="name">Event Tracks</field>
|
||||
<field name="inherit_id" ref="website_event.event_event_view_form_inherit_website"/>
|
||||
<field name="inherit_id" ref="event.view_event_form"/>
|
||||
<field name="model">event.event</field>
|
||||
<field name="priority" eval="3"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="is_published" position="before">
|
||||
<div name="button_box" position="inside">
|
||||
<button name="%(action_event_track_from_event)d"
|
||||
type="action"
|
||||
class="oe_stat_button"
|
||||
icon="fa-inbox"
|
||||
icon="fa-microphone"
|
||||
context="{'default_date': date_begin}">
|
||||
<field name="track_count" string="Tracks" widget="statinfo"/>
|
||||
</button>
|
||||
<button name="%(event_sponsor_action_from_event)d"
|
||||
type="action"
|
||||
class="oe_stat_button"
|
||||
icon="fa-users">
|
||||
icon="fa-black-tie">
|
||||
<field name="sponsor_count" string="Sponsors" widget="statinfo"/>
|
||||
</button>
|
||||
</field>
|
||||
<label for="website_menu" position="after">
|
||||
<field name="website_track" attrs="{'invisible': [('website_menu', '=', False)]}"/>
|
||||
<label for="website_track" string="Tracks on Website" attrs="{'invisible': [('website_menu', '=', False)]}"/>
|
||||
<field name="website_track_proposal" attrs="{'invisible': [('website_menu', '=', False)]}"/>
|
||||
<label for="website_track_proposal" string="Track Proposals on Website" attrs="{'invisible': [('website_menu', '=', False)]}"/>
|
||||
</label>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user