summaryrefslogtreecommitdiff
path: root/addons/gamification/data/cron.xml
diff options
context:
space:
mode:
authorPatrick Hoste <pko@odoo.com>2019-06-27 07:54:04 +0000
committerThibault Delavallée <tde@odoo.com>2019-11-05 15:08:34 +0000
commitbfbc7c6a184b2b507b1bf4ad778430bc2f3a0e7f (patch)
tree76cc91bd7b3b2011c7930e084ed77cc12dcac980 /addons/gamification/data/cron.xml
parentc27ba2af1c640d91c6d7605412228687cc99cbd0 (diff)
[IMP] gamification: track karma change on users
PURPOSE Allow karma gain tracking enabling notably display of top users based on weekly / monthly gain in website profile. SPECIFCIATIONS Each time a user gains karma a record is created in the gamification karma tracking model. Scheduled activity runs to consolidate the records into monthly gain records to avoid having crowdy table and unnecessary noise in karma gain. This model is made private and only accessible through some dedicated compute methods / controllers used in website profile. In website profile module buttons are added to see users ranking based on their total karma (like before) but also by last week and last month gains (using the newly introduced tracking model). LINKS Task ID 2003505 PR #34594
Diffstat (limited to 'addons/gamification/data/cron.xml')
-rw-r--r--addons/gamification/data/cron.xml13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/gamification/data/cron.xml b/addons/gamification/data/cron.xml
index 0ed59d39e11..4e59205647b 100644
--- a/addons/gamification/data/cron.xml
+++ b/addons/gamification/data/cron.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record forcecreate="True" id="ir_cron_check_challenge" model="ir.cron">
@@ -10,5 +11,17 @@
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
+
+ <record id="ir_cron_consolidate_last_month" model="ir.cron">
+ <field name="name">Gamification: Karma tracking consolidation</field>
+ <field name="model_id" ref="model_gamification_karma_tracking"/>
+ <field name="state">code</field>
+ <field name="code">model._consolidate_last_month()</field>
+ <field name="active" eval="True"/>
+ <field name="interval_number">1</field>
+ <field name="interval_type">months</field>
+ <field name="numbercall">-1</field>
+ <field name="nextcall" eval="(DateTime.now() + relativedelta(day=1, months=1)).strftime('%Y-%m-%d 04:00:00')" />
+ </record>
</data>
</odoo>