From d169b5b509ac4d8d935bb00785744fcfc11d92ca Mon Sep 17 00:00:00 2001 From: Nasreddin Boulif Date: Wed, 10 Jun 2020 10:18:26 +0000 Subject: [PATCH] [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 --- addons/event/models/event_registration.py | 2 +- addons/event/static/src/scss/event.scss | 8 +++ addons/event/views/event_views.xml | 68 +++++++++++++++---- .../views/event_registration_views.xml | 12 ---- 4 files changed, 62 insertions(+), 28 deletions(-) diff --git a/addons/event/models/event_registration.py b/addons/event/models/event_registration.py index 3f13a2917c9..d1cadb4c8c5 100644 --- a/addons/event/models/event_registration.py +++ b/addons/event/models/event_registration.py @@ -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, diff --git a/addons/event/static/src/scss/event.scss b/addons/event/static/src/scss/event.scss index 821ad23e09c..ec8ff7be2d0 100644 --- a/addons/event/static/src/scss/event.scss +++ b/addons/event/static/src/scss/event.scss @@ -16,3 +16,11 @@ } } } + +.o_kanban_view.o_event_attendee_kanban_view { + @media (max-width: 768px) { + .o_event_registration_kanban { + min-height: 80px; + } + } +} diff --git a/addons/event/views/event_views.xml b/addons/event/views/event_views.xml index 743f570ac42..d572dd671c3 100644 --- a/addons/event/views/event_views.xml +++ b/addons/event/views/event_views.xml @@ -152,10 +152,11 @@ event.registration Attendees kanban,tree,form,calendar,graph - {'search_default_event_id': active_id, 'default_event_id': active_id} + [('event_id', '=', active_id)] + {'default_event_id': active_id}

- Add a new attendee + Create an Attendee

@@ -560,28 +561,65 @@ event.registration 10 - + + - -
-
- + +
+
+ - - + + + Attended + Canceled
-
-
- +
+ + +
+ + + + + + +
+ Attended + Canceled +
+
+
+ +
+
+
+
+
+ + + Booked by +
+ +
+ +
+
+
+
+
-
- +
+ +
@@ -667,7 +705,7 @@ Attendees event.registration - pivot,graph,tree,form + pivot,graph,kanban,tree,form {} diff --git a/addons/event_sale/views/event_registration_views.xml b/addons/event_sale/views/event_registration_views.xml index 5365c7d1e77..3d409b804e6 100644 --- a/addons/event_sale/views/event_registration_views.xml +++ b/addons/event_sale/views/event_registration_views.xml @@ -12,18 +12,6 @@ - - event.registration.kanban.inherit - event.registration - - - -
- -
-
-
- event.registration.form.inherit event.registration