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.
18 lines
732 B
XML
18 lines
732 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<record id="ir_cron_mail_gateway_action" model="ir.cron">
|
|
<field name="name">Mail: Fetchmail Service</field>
|
|
<field name="model_id" ref="model_fetchmail_server"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._fetch_mails()</field>
|
|
<field name="interval_number">5</field>
|
|
<field name="interval_type">minutes</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
<!-- Active flag is set on fetchmail_server.create/write -->
|
|
<field name="active" eval="False"/>
|
|
</record>
|
|
</data>
|
|
</odoo>
|