[CLEAN] event: removed unnecessary count_registrations field;
on form view, display attendees (not canceled, ...) instead of registration count.
This commit is contained in:
@@ -113,13 +113,6 @@ class event_event(models.Model):
|
||||
registration_ids = fields.One2many(
|
||||
'event.registration', 'event_id', string='Attendees',
|
||||
readonly=False, states={'done': [('readonly', True)]})
|
||||
count_registrations = fields.Integer(string='Registrations', compute='_count_registrations')
|
||||
|
||||
@api.one
|
||||
@api.depends('registration_ids')
|
||||
def _count_registrations(self):
|
||||
self.count_registrations = len(self.registration_ids)
|
||||
|
||||
# Date fields
|
||||
date_tz = fields.Selection('_tz_get', string='Timezone', default=lambda self: self.env.user.tz)
|
||||
date_begin = fields.Datetime(
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
class="oe_stat_button oe_inline"
|
||||
icon="fa-github"
|
||||
help="Register with this event">
|
||||
<field name="count_registrations" widget="statinfo" string="Attendees"/>
|
||||
<field name="seats_reserved" widget="statinfo" string="Attendees"/>
|
||||
</button>
|
||||
</div>
|
||||
<group name="main_field_group">
|
||||
|
||||
Reference in New Issue
Block a user