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.
15 lines
538 B
XML
15 lines
538 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="ir_cron_twitter_actions" model="ir.cron">
|
|
<field name="name">Twitter: Fetch new favorites</field>
|
|
<field name="model_id" ref="model_website"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._refresh_favorite_tweets()</field>
|
|
<field name="interval_number">2</field>
|
|
<field name="interval_type">hours</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
</odoo>
|
|
|