summaryrefslogtreecommitdiff
path: root/addons/mail/data/mail_data.xml
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2016-12-14 13:34:48 +0100
committerThibault Delavallée <tde@odoo.com>2017-01-03 19:11:07 +0100
commit1c79c5ee3050ad8ba907aeda70c0d1f3dbe837a0 (patch)
tree9f5b6364cb0dfecd0b699db0b448786d8801f450 /addons/mail/data/mail_data.xml
parent870974effeb77f1125394816aa10b96f7f1b1941 (diff)
[REF] ir_cron: make scheduled actions inherits from server actions
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.
Diffstat (limited to 'addons/mail/data/mail_data.xml')
-rw-r--r--addons/mail/data/mail_data.xml17
1 files changed, 8 insertions, 9 deletions
diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml
index aa4cae02f30..6db20b0f592 100644
--- a/addons/mail/data/mail_data.xml
+++ b/addons/mail/data/mail_data.xml
@@ -2,29 +2,28 @@
<odoo>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_mail_scheduler_action" model="ir.cron">
- <field name="name">Email Queue Manager</field>
+ <field name="name">Mail: Email Queue Manager</field>
+ <field name="model_id" ref="model_mail_mail"/>
+ <field name="state">code</field>
+ <field name="code">model.process_email_queue()</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 eval="False" name="doall"/>
- <field eval="'mail.mail'" name="model"/>
- <field eval="'process_email_queue'" name="function"/>
- <field eval="'()'" name="args"/>
</record>
<record id="ir_cron_module_update_notification" model="ir.cron">
- <field name="name">Update Notification</field>
- <field eval="True" name="active" />
+ <field name="name">Publisher: Update Notification</field>
+ <field name="model_id" ref="model_publisher_warranty_contract"/>
+ <field name="state">code</field>
+ <field name="code">model.update_notification(None)</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">weeks</field>
<field name="numbercall">-1</field>
<field name="nextcall" eval="(DateTime.now() + timedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S')" />
<field eval="False" name="doall" />
- <field eval="'publisher_warranty.contract'" name="model" />
- <field eval="'update_notification'" name="function" />
- <field eval="'(None,)'" name="args" />
<field name="priority">1000</field>
</record>