[IMP] event: improve attendees kanban view
PURPOSE
Introduce a clearer way of handling registrations for single / multiple events
occurring at the same time and place by
* improve attendees kanban view, notably by better supporting mono and multi
event (hide unnecessary information);
* introducing a Registration Desk menu item to manage multi-event mode;
SPECIFICATIONS
Improve attendees kanban view, notably due to the following issues
* event_ticket_id as char field is hard to recognize. Notably with attendees
with same ticket directly in the kanban view;
* missing explicit icon/button of the event registration state;
Handle mono-event (coming from an event) / multi-event (global attendees
view) modes.
Replace "event_ticket_id" text by colored badge (random color on each
"event.event_ticket_id.id"). Move this field directly into event as now
tickets are supported in event, not only with event_sale.
Add button or text linked to the registration state.
Kanban card structure is therefore
-----------------------
Attendee Name
Event Name (if in multi mode)
Booked by partner_id.display_name ICON/BUTTON
Ticket in a tag format
-----------------------
Buttons and icons, if registrations is
* canceled (nothing to do in Kanban, open the form view) => Canceled text
* unconfirmed and is awaiting confirmation => Attended text
* confirmed and is awaiting attendance confirmation => Button
* done, end of the flow => Icon
Mobile specific: put button as big buttons on the right of the card, ensure
all cards are displayed using same height and display correct.
LINKS
Task ID #2214290
PR #47511
This commit is contained in:
committed by
Thibault Delavallée
parent
e1e9e8c780
commit
d169b5b509
@@ -28,7 +28,7 @@ class EventRegistration(models.Model):
|
||||
utm_medium_id = fields.Many2one('utm.medium', 'Medium', index=True, ondelete='set null')
|
||||
# attendee
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='Contact',
|
||||
'res.partner', string='Booked by',
|
||||
states={'done': [('readonly', True)]})
|
||||
name = fields.Char(
|
||||
string='Attendee Name', index=True,
|
||||
|
||||
@@ -16,3 +16,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.o_kanban_view.o_event_attendee_kanban_view {
|
||||
@media (max-width: 768px) {
|
||||
.o_event_registration_kanban {
|
||||
min-height: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,10 +152,11 @@
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="name">Attendees</field>
|
||||
<field name="view_mode">kanban,tree,form,calendar,graph</field>
|
||||
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id}</field>
|
||||
<field name="domain">[('event_id', '=', active_id)]</field>
|
||||
<field name="context">{'default_event_id': active_id}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Add a new attendee
|
||||
Create an Attendee
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
@@ -560,28 +561,65 @@
|
||||
<field name="model">event.registration</field>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_event_attendee_kanban" default_order="name, create_date desc">
|
||||
<kanban class="o_event_attendee_kanban_view" default_order="name, create_date desc">
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="state"/>
|
||||
<field name="email"/>
|
||||
<field name="event_ticket_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="float-right">
|
||||
<a class="btn btn-sm btn-success" string="Confirm Registration" name="action_confirm" type="object" states="draft" role="button">
|
||||
<t t-name="event_attendees_kanban_icons_desktop">
|
||||
<div class="d-none d-md-block h-100">
|
||||
<div id="event_attendees_kanban_icons_desktop" class="h-100 float-right p-2 d-flex align-items-end flex-column">
|
||||
<a class="btn btn-md btn-primary" string="Confirm Registration" name="action_confirm" type="object" states="draft" role="button">
|
||||
<i class="fa fa-check" role="img" aria-label="Confirm button" title="Confirm Registration"/>
|
||||
</a>
|
||||
<a class="btn btn-sm btn-success" string="Attended the Event" name="action_set_done" type="object" states="open" role="button">
|
||||
<i class="fa fa-level-down" role="img" aria-label="Attended button" title="Attended the Event"/>
|
||||
<a class="btn btn-md btn-primary" string="Confirm Attendance" name="action_set_done" type="object" states="open" role="button">
|
||||
<i class="fa fa-user-plus" role="img" aria-label="Attended button" title="Confirm Attendance"/>
|
||||
</a>
|
||||
<span class="text-muted" states="done">Attended</span>
|
||||
<span class="text-muted" states="cancel">Canceled</span>
|
||||
</div>
|
||||
<div class="oe_kanban_content">
|
||||
<div class="o_kanban_record_top">
|
||||
<b class="o_kanban_record_title"><field name="display_name"/></b>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="event_attendees_kanban_icons_mobile">
|
||||
<div id="event_attendees_kanban_icons_mobile" class="d-md-none h-100 pl-4">
|
||||
<a class="btn btn-primary d-flex justify-content-center align-items-center h-100 w-100"
|
||||
string="Confirm Registration" name="action_confirm" type="object" states="draft" role="button">
|
||||
<i class="fa fa-check fa-3x" role="img" aria-label="Confirm button" title="Confirm Registration"/>
|
||||
</a>
|
||||
<a class="btn btn-primary d-flex justify-content-center align-items-center h-100 w-100"
|
||||
string="Confirm Attendance" name="action_set_done" type="object" states="open" role="button">
|
||||
<i class="fa fa-user-plus fa-3x" role="img" aria-label="Attended button" title="Confirm Attendance"/>
|
||||
</a>
|
||||
<div class="d-flex justify-content-center align-items-center h-100 w-100">
|
||||
<span class="text-muted" states="done" >Attended</span>
|
||||
<span class="text-muted" states="cancel" >Canceled</span>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click o_event_registration_kanban container-fluid p-0">
|
||||
<div class="row h-100">
|
||||
<div class="col-9 pr-0">
|
||||
<div class="oe_kanban_content h-100">
|
||||
<div class="o_kanban_record_body pt-1 pl-2 h-100 d-flex flex-column">
|
||||
<b class="o_kanban_record_title"><field name="name"/></b>
|
||||
<field name="event_id" invisible="context.get('default_event_id')" />
|
||||
<span attrs="{'invisible': [('partner_id', '=', False)]}">Booked by <field name="partner_id" /></span>
|
||||
<div id="event_ticket_id" class="o_field_many2manytags o_field_widget d-flex mt-auto">
|
||||
<t t-if="record.event_ticket_id.raw_value">
|
||||
<div t-attf-class="badge badge-pill o_tag_color_#{(record.event_ticket_id.raw_value % 11) + 1}" >
|
||||
<b><span class="o_badge_text"><t t-esc="record.event_ticket_id.value"/></span></b>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_body">
|
||||
<field name="event_id"/>
|
||||
<div id="event_attendees_kanban_icons" class="col-3 pl-0">
|
||||
<t t-call="event_attendees_kanban_icons_desktop"/>
|
||||
<t t-call="event_attendees_kanban_icons_mobile"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -667,7 +705,7 @@
|
||||
<field name="name">Attendees</field>
|
||||
<field name="res_model">event.registration</field>
|
||||
<field name="domain"></field>
|
||||
<field name="view_mode">pivot,graph,tree,form</field>
|
||||
<field name="view_mode">pivot,graph,kanban,tree,form</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="search_view_id" ref="view_registration_search"/>
|
||||
</record>
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="event_registration_view_kanban" model="ir.ui.view">
|
||||
<field name="name">event.registration.kanban.inherit</field>
|
||||
<field name="model">event.registration</field>
|
||||
<field name="inherit_id" ref="event.event_registration_view_kanban"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='event_id']" position="after">
|
||||
<br/>
|
||||
<field name="event_ticket_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_event_registration_ticket_form" model="ir.ui.view">
|
||||
<field name="name">event.registration.form.inherit</field>
|
||||
<field name="model">event.registration</field>
|
||||
|
||||
Reference in New Issue
Block a user