diff options
| author | Thibault Delavallée <tde@odoo.com> | 2016-12-14 13:34:48 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2017-01-03 19:11:07 +0100 |
| commit | 1c79c5ee3050ad8ba907aeda70c0d1f3dbe837a0 (patch) | |
| tree | 9f5b6364cb0dfecd0b699db0b448786d8801f450 /addons/gamification/data/cron.xml | |
| parent | 870974effeb77f1125394816aa10b96f7f1b1941 (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/gamification/data/cron.xml')
| -rw-r--r-- | addons/gamification/data/cron.xml | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/gamification/data/cron.xml b/addons/gamification/data/cron.xml index 6e273ef4405..0ed59d39e11 100644 --- a/addons/gamification/data/cron.xml +++ b/addons/gamification/data/cron.xml @@ -1,15 +1,14 @@ <odoo> <data noupdate="1"> - <record forcecreate="True" id="ir_cron_check_challenge" - model="ir.cron"> - <field name="name">Run Goal Challenge Checker</field> + <record forcecreate="True" id="ir_cron_check_challenge" model="ir.cron"> + <field name="name">Gamification: Goal Challenge Check</field> + <field name="model_id" ref="model_gamification_challenge"/> + <field name="state">code</field> + <field name="code">model._cron_update()</field> <field name="interval_number">1</field> <field name="interval_type">days</field> <field name="numbercall">-1</field> <field eval="False" name="doall" /> - <field name="model">gamification.challenge</field> - <field name="function">_cron_update</field> - <field name="args">()</field> </record> </data> </odoo> |
