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/pos_cache/data | |
| 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/pos_cache/data')
| -rw-r--r-- | addons/pos_cache/data/pos_cache_data.xml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/pos_cache/data/pos_cache_data.xml b/addons/pos_cache/data/pos_cache_data.xml index 709e6edea35..8bb58b41a4a 100644 --- a/addons/pos_cache/data/pos_cache_data.xml +++ b/addons/pos_cache/data/pos_cache_data.xml @@ -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> |
