[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.
This commit is contained in:
Thibault Delavallée
2017-01-03 19:11:07 +01:00
parent 870974effe
commit 1c79c5ee30
24 changed files with 159 additions and 211 deletions
+4 -4
View File
@@ -2,15 +2,15 @@
<odoo>
<data>
<record model="ir.cron" id="refresh_pos_cache_cron">
<field name="name">Refresh POS Cache</field>
<field name="name">PoS: refresh cache</field>
<field name="model_id" ref="model_pos_cache"/>
<field name="state">code</field>
<field name="code">model.refresh_all_caches()</field>
<field name="active" eval="False"/>
<field name="interval_number">1</field>
<field name="interval_type">hours</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model" eval="'pos.cache'"/>
<field name="function" eval="'refresh_all_caches'"/>
<field name="args" eval="'()'"/>
</record>
</data>
</odoo>