[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
This commit is contained in:
Denis Ledoux
2015-06-11 16:50:24 +02:00
parent d802f5f694
commit b94e365dc7
2 changed files with 12 additions and 5 deletions
+4
View File
@@ -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(
+8 -5
View File
@@ -46,7 +46,7 @@
<field name="view_type">form</field>
<field name="name">Attendees</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id}</field>
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id, 'search_default_expected': True}</field>
</record>
<!-- EVENT.EVENT VIEWS -->
@@ -73,7 +73,7 @@
class="oe_stat_button oe_inline"
icon="fa-github"
help="Register with this event">
<field name="seats_reserved" widget="statinfo" string="Attendees"/>
<field name="seats_expected" widget="statinfo" string="Attendees"/>
</button>
</div>
<group name="main_field_group">
@@ -156,6 +156,8 @@
<field name="date_end"/>
<field name="seats_unconfirmed"/>
<field name="seats_reserved"/>
<field name="seats_used"/>
<field name="seats_expected"/>
<field name="color"/>
<templates>
<t t-name="kanban-box">
@@ -192,10 +194,10 @@
</div>
<h4>
<a name="%(act_event_registration_from_event)d" type="action">
<t t-esc="record.seats_reserved.raw_value" > Attendees</t>
<t t-esc="record.seats_expected.raw_value"> Attendees Expected</t>
</a>
<t t-if="(record.seats_reserved.raw_value + record.seats_unconfirmed.raw_value) > 0 ">&#47;
<t t-esc="record.seats_reserved.raw_value + record.seats_unconfirmed.raw_value"/> Expected
<t t-if="(record.seats_reserved.raw_value + record.seats_used.raw_value) > 0 "><br/>
<t t-esc="record.seats_reserved.raw_value + record.seats_used.raw_value"/> Attendees Confirmed
<a name="action_event_registration_report" type="object" >&#40;Report&#41;</a>
</t>
</h4>
@@ -369,6 +371,7 @@
<field name="id" string="Registration ID"/>
<field name="name" string="Participant" filter_domain="['|', '|', ('name', 'ilike', self), ('email', 'ilike', self), ('origin', 'ilike', self)]"/>
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<filter string="Expected" name="expected" domain="[('state', 'in', ['draft', 'open', 'done'])]"/>
<separator/>
<field name="event_id"/>
<field name="partner_id"/>