2 # Parent 8c721171aa16a41e94059f53d6780c67b5ef2dfc
4 Index: addons/openacademy/models.py
5 ===================================================================
6 --- addons.orig/openacademy/models.py 2014-08-26 17:26:14.907783150 +0200
7 +++ addons/openacademy/models.py 2014-08-26 17:26:14.899783151 +0200
9 attendees_count = fields.Integer(
10 string="Attendees count", compute='_get_attendees_count', store=True)
12 + state = fields.Selection([
14 + ('confirmed', "Confirmed"),
19 + def action_draft(self):
20 + self.state = 'draft'
23 + def action_confirm(self):
24 + self.state = 'confirmed'
27 + def action_done(self):
31 @api.depends('seats', 'attendee_ids')
32 def _taken_seats(self):
33 Index: addons/openacademy/views/openacademy.xml
34 ===================================================================
35 --- addons.orig/openacademy/views/openacademy.xml 2014-08-26 17:26:14.907783150 +0200
36 +++ addons/openacademy/views/openacademy.xml 2014-08-26 17:26:14.899783151 +0200
38 <field name="model">openacademy.session</field>
39 <field name="arch" type="xml">
40 <form string="Session Form">
42 + <button name="action_draft" type="object"
43 + string="Reset to draft"
44 + states="confirmed,done"/>
45 + <button name="action_confirm" type="object"
46 + string="Confirm" states="draft"
47 + class="oe_highlight"/>
48 + <button name="action_done" type="object"
49 + string="Mark as done" states="confirmed"
50 + class="oe_highlight"/>
51 + <field name="state" widget="statusbar"/>
56 <group string="General">