This commit adds a way to configure scheduled emails on events. It replaces existing automatic emails at confirmation and subscription. It proposes to configure some schedulers, based on subscription or event, using a template and a configurable timedelta. A cron is added that regularly checks for event mailing schedulers to execute and launch them. The granularity of send emails is therefore limited to the granularity of the cron, aka 1 hour. [TEST] Added tests for this feature. Also cleaned a bit event, country_id is now a pure related instead of a computed field trying to be a related. Also removed default templates on event category. Configuration in the event itself should be easy enough for most use cases.
49 lines
2.2 KiB
XML
49 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data noupdate="1">
|
|
|
|
<!-- After installation of the module, open the related menu -->
|
|
<record id="action_client_event_menu" model="ir.actions.client">
|
|
<field name="name">Open Event Menu</field>
|
|
<field name="tag">reload</field>
|
|
<field name="params" eval="{'menu_id': ref('event.menu_event_event')}"/>
|
|
</record>
|
|
<record id="base.open_menu" model="ir.actions.todo">
|
|
<field name="action_id" ref="action_client_event_menu"/>
|
|
<field name="state">open</field>
|
|
</record>
|
|
|
|
<!-- Event-related subtypes for messaging / Chatter -->
|
|
<record id="event.mt_event_registration" model="mail.message.subtype">
|
|
<field name="name">New Registration</field>
|
|
<field name="res_model">event.event</field>
|
|
<field name="default" eval="False"/>
|
|
</record>
|
|
|
|
<!-- notify all employees of module installation -->
|
|
<function model="mail.group" name="message_post">
|
|
<value eval="[ref('mail.group_all_employees')]"/>
|
|
<value>From the top menu Events, you can organize events, manage registrations, automate communication around your event and sell events through your quotations.</value>
|
|
<value>Module Events has been installed</value>
|
|
</function>
|
|
|
|
<!-- Automatic confirmation of events by default -->
|
|
<function id="default_auto_confirmation" model="ir.values" name="set_default" eval="('marketing.config.settings', 'auto_confirmation', True)"/>
|
|
|
|
<!-- Event Mail Scheduler-->
|
|
<record model="ir.cron" forcecreate="True" id="event_mail_scheduler">
|
|
<field name="name">[event] mail scheduler</field>
|
|
<field name="active">True</field>
|
|
<field name="user_id" ref="base.user_root"/>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">hours</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False" />
|
|
<field eval="'()'" name="args"/>
|
|
<field name="model">event.mail</field>
|
|
<field name="function">run</field>
|
|
</record>
|
|
|
|
</data>
|
|
</openerp>
|