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(
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">