[IMP] event: improve event (mass) mailing

Mass mailing option is activated on attendee and track models. Using
the _mail_mass_mailing parameter on class allows to see those models
in the mass mailing application without having bridge module.

This commit also improves the scheduled mail form view and slighty
improve labels related to scheduling mails on event.
This commit is contained in:
Mitali Patel
2017-03-03 13:04:36 +01:00
committed by Thibault Delavallée
parent 66d8567a25
commit a650e5de58
4 changed files with 32 additions and 23 deletions
+1
View File
@@ -277,6 +277,7 @@ class EventRegistration(models.Model):
_description = 'Attendee'
_inherit = ['mail.thread']
_order = 'name, create_date desc'
_mail_mass_mailing = _('Event Attendees')
origin = fields.Char(
string='Source Document', readonly=True,
+1 -1
View File
@@ -33,7 +33,7 @@ class EventMailScheduler(models.Model):
('after_sub', 'After each registration'),
('before_event', 'Before the event'),
('after_event', 'After the event')],
string='When to Run ', default="before_event", required=True)
string='Trigger ', default="before_event", required=True)
template_id = fields.Many2one(
'mail.template', string='Email to Send',
domain=[('model', '=', 'event.registration')], required=True, ondelete='restrict',
+29 -22
View File
@@ -423,28 +423,35 @@
<field name="model">event.mail</field>
<field name="arch" type="xml">
<form string="Event Mail Scheduler">
<group>
<field name="event_id"/>
<field name="template_id"/>
<field name="mail_sent"/>
</group>
<group>
<field name="interval_nbr" attrs="{'readonly':[('interval_unit', '=', 'now')]}"/>
<field name="interval_unit"/>
<field name="interval_type"/>
<field name="scheduled_date"/>
</group>
<notebook>
<page string="Registration Mails">
<field name="mail_registration_ids">
<tree string="Registration mail" editable="bottom">
<field name="registration_id"/>
<field name="scheduled_date"/>
<field name="mail_sent"/>
</tree>
</field>
</page>
</notebook>
<sheet>
<group>
<group>
<field name="event_id"/>
<field name="template_id"/>
<field name="mail_sent"/>
</group>
<group>
<label for="interval_nbr"/>
<div class="o_row">
<field name="interval_nbr" attrs="{'invisible': [('interval_unit', '=', 'now')], 'readonly': [('interval_unit', '=', 'now')]}"/>
<field name="interval_unit"/>
</div>
<field name="interval_type"/>
<field name="scheduled_date"/>
</group>
</group>
<notebook>
<page string="Registration Mails">
<field name="mail_registration_ids">
<tree string="Registration mail" editable="bottom">
<field name="registration_id"/>
<field name="scheduled_date"/>
<field name="mail_sent"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
@@ -32,6 +32,7 @@ class Track(models.Model):
_description = 'Event Track'
_order = 'priority, date'
_inherit = ['mail.thread', 'website.seo.metadata', 'website.published.mixin']
_mail_mass_mailing = _('Track Speakers')
name = fields.Char('Title', required=True, translate=True)
active = fields.Boolean(default=True)