From b94e365dc7a1e77aa77f44583bdec2e4867dc518 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 11 Jun 2015 16:43:29 +0200 Subject: [PATCH] [FIX] event: Attendees stat button in event form/kanban The stat button count included only reserved seats, while, when clicking on the button, all attendees were displayed: draft, confirmed, canceled, done. Usability speaking, this isn't right. Besides, once the attendee actually attended the event, it wasn't anymore included in the count, which is not logical either: by "Confirmed", you expect the reserved attendees and the attendees already there. In addition, on the kanban view, the link said "confirmed" attendees as well, but redirected to the list with all attendees. The "expected attendees" value on the kanban was along a "report" link, bringing to the report where only confirmed seats are displayed. Kind of non-sense. Finally, the decision made: - For an event, the more natural count that you want to see first is the "expected" attendees, including draft, reserved and attended attendees. - Both buttons, on the form view and the kanban view now includes draft, open and done attendees, and redirect to the list view displaying only these attendees (canceled excluded). - On the kanban view, you have a count more including the confirmed attendees, including the open and the done attendees. opw-642134 --- addons/event/event.py | 4 ++++ addons/event/event_view.xml | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/addons/event/event.py b/addons/event/event.py index ab4b6e8f9fa..fc38d2e0ab0 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -80,6 +80,9 @@ class event_event(models.Model): seats_used = fields.Integer( oldname='register_attended', string='Number of Participations', store=True, readonly=True, compute='_compute_seats') + seats_expected = fields.Integer( + string='Number of Expected Attendees', + readonly=True, compute='_compute_seats') @api.multi @api.depends('seats_max', 'registration_ids.state') @@ -108,6 +111,7 @@ class event_event(models.Model): for event in self: if event.seats_max > 0: event.seats_available = event.seats_max - (event.seats_reserved + event.seats_used) + event.seats_expected = event.seats_unconfirmed + event.seats_reserved + event.seats_used # Registration fields registration_ids = fields.One2many( diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 3d6830517cc..9aa98ad2bc2 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -46,7 +46,7 @@ form Attendees tree,form,calendar,graph - {'search_default_event_id': active_id, 'default_event_id': active_id} + {'search_default_event_id': active_id, 'default_event_id': active_id, 'search_default_expected': True} @@ -73,7 +73,7 @@ class="oe_stat_button oe_inline" icon="fa-github" help="Register with this event"> - + @@ -156,6 +156,8 @@ + + @@ -192,10 +194,10 @@

- Attendees + Attendees Expected - / - Expected +
+ Attendees Confirmed (Report)

@@ -369,6 +371,7 @@ +