[CLEAN] event: removed unnecessary count_registrations field;
authorThibault Delavallée <tde@openerp.com>
Mon, 17 Nov 2014 12:28:05 +0000 (13:28 +0100)
committerThibault Delavallée <tde@openerp.com>
Mon, 17 Nov 2014 13:09:33 +0000 (14:09 +0100)
on form view, display attendees (not canceled, ...) instead of
registration count.

addons/event/event.py
addons/event/event_view.xml

index 6038869..adce860 100644 (file)
@@ -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(
index 278959a..d30545f 100644 (file)
@@ -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">