The purpose of this commit is to handle code execution only in server action and delegate schedule management to ir_cron model. ir.cron model now inherits from ir.actions.server. Fields model, function and args are removed as well as the logic to handle them. There is no more code manipulation and evaluation in ir_cron, only a call to the run method of ir.actions.server. Cron form view use server action form view as primary view. This way automated actions use the same base form as server actions with cron details added. Thanks to @fpodoo for the original idea and preliminary work. Thanks to @jpr-odoo for first developments. Thanks to @jem-odoo for reviewing.
29 lines
1.3 KiB
XML
29 lines
1.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<!-- notify all employees of module installation -->
|
|
<function model="mail.channel" name="message_post">
|
|
<value eval="[ref('mail.channel_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="('event.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="model_id" ref="model_event_mail"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model.run(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" />
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|