Skip to content

Commit

Permalink
[IMP] event: usability improvements
Browse files Browse the repository at this point in the history
- New filter "not cancelled" for attendees management
- No more readonly nor invisibility on "minimum number of seats"
- Event questions and mail scheduling have been put under an optional
  tab
  • Loading branch information
tivisse authored and rim-odoo committed Apr 22, 2015
1 parent 01b536b commit 581c2f1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
3 changes: 1 addition & 2 deletions addons/event/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _default_event_mail_ids(self):
return [(0, 0, {
'interval_unit': 'now',
'interval_type': 'after_sub',
'template_id': self.env['ir.model.data'].xmlid_to_res_id('event.event_subscription')
'template_id': self.env.ref('event.event_subscription')
})]

# Seats and computation
Expand All @@ -66,7 +66,6 @@ def _default_event_mail_ids(self):
'Available Seat', required=True, default='unlimited')
seats_min = fields.Integer(
string='Minimum Reserved Seats', oldname='register_min',
readonly=True, states={'draft': [('readonly', False)]},
help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )")
seats_reserved = fields.Integer(
oldname='register_current', string='Reserved Seats',
Expand Down
7 changes: 4 additions & 3 deletions addons/event/event_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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_not_cancelled': 1}</field>
</record>

<!-- EVENT.EVENT VIEWS -->
Expand Down Expand Up @@ -95,13 +95,13 @@
<group>
<group>
<field name="auto_confirm" invisible="1"/>
<field name="seats_min" attrs="{'invisible':[('auto_confirm','=', True)]}"/>
<field name="seats_min"/>
<field name="seats_availability" widget='radio'/>
<field name="seats_max" attrs="{'invisible': [('seats_availability', '=', 'unlimited')], 'required': [('seats_availability', '=', 'limited')]}"/>
</group>
</group>
</page>
<page string="Email Schedule">
<page string="Email Schedule" groups="event.group_email_scheduling">
<group>
<field name="reply_to"/>
</group>
Expand Down Expand Up @@ -369,6 +369,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="Not Cancelled" name="not_cancelled" domain="[('state','!=','cancel')]"/>
<separator/>
<field name="event_id"/>
<field name="partner_id"/>
Expand Down
8 changes: 8 additions & 0 deletions addons/event/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ class event_config_settings(osv.TransientModel):
help='Install the event_sale module'),
'module_website_event_track': fields.boolean(
'Organize few days event with track, full agenda, own menu in website'),
'module_website_event_questions': fields.boolean(
'Ask questions to online subscribers',
help='Install the website_event_questions module',
implied_group='event.group_website_event_questions'),
'auto_confirmation': fields.boolean(
'Automate events and subscription confirmation', help='Unselect this option to manually manage draft event and draft subscription'),
'group_email_scheduling': fields.boolean(
'Schedule emails to attendees and subscribers',
help='You will be able to configure emails, and to schedule them to be automatically sent to the attendees on subscription and/or attendance',
implied_group='event.group_email_scheduling'),
}

def set_default_auto_confirmation(self, cr, uid, ids, context=None):
Expand Down
8 changes: 8 additions & 0 deletions addons/event/res_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@
<field name="module_website_event_track"/>
<label for="module_website_event_track"/>
</div>
<div name="div_website_event_questions">
<field name="module_website_event_questions"/>
<label for="module_website_event_questions"/>
</div>
<div name="div_auto_confirmation">
<field name="auto_confirmation"/>
<label for="auto_confirmation"/>
</div>
<div name="div_email_scheduling">
<field name="group_email_scheduling"/>
<label for="group_email_scheduling"/>
</div>
</div>
</group>
</div>
Expand Down
10 changes: 10 additions & 0 deletions addons/event/security/event_security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

<record id="group_email_scheduling" model="res.groups">
<field name="name">Schedule Emails on Event Subscription</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_website_event_questions" model="res.groups">
<field name="name">Ask Questions to Online Subscribers</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>

</data>

<data noupdate="1">
Expand Down
2 changes: 1 addition & 1 deletion addons/event_sale/views/event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<group>
<group>
<field name="auto_confirm" invisible="1"/>
<field name="seats_min" attrs="{'invisible':[('auto_confirm','=', True)]}"/>
<field name="seats_min"/>
<field name="seats_availability" widget='radio'/>
<field name="seats_max" attrs="{'invisible': [('seats_availability', '=', 'unlimited')], 'required': [('seats_availability', '=', 'limited')]}"/>
</group>
Expand Down

0 comments on commit 581c2f1

Please sign in to comment.