diff options
| author | Patrick Hoste <pko@odoo.com> | 2019-06-27 07:54:04 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2019-11-05 15:08:34 +0000 |
| commit | bfbc7c6a184b2b507b1bf4ad778430bc2f3a0e7f (patch) | |
| tree | 76cc91bd7b3b2011c7930e084ed77cc12dcac980 /addons/gamification/views/gamification_karma_tracking_views.xml | |
| parent | c27ba2af1c640d91c6d7605412228687cc99cbd0 (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/views/gamification_karma_tracking_views.xml')
| -rw-r--r-- | addons/gamification/views/gamification_karma_tracking_views.xml | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/addons/gamification/views/gamification_karma_tracking_views.xml b/addons/gamification/views/gamification_karma_tracking_views.xml new file mode 100644 index 00000000000..998d0ff91ec --- /dev/null +++ b/addons/gamification/views/gamification_karma_tracking_views.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo><data> + <record id="gamification_karma_tracking_view_search" model="ir.ui.view"> + <field name="name">gamification.karma.tracking.view.search</field> + <field name="model">gamification.karma.tracking</field> + <field name="arch" type="xml"> + <search string="Search Trackings"> + <field name="user_id"/> + <field name="tracking_date"/> + <filter string="Consolidated" name="filter_consolidated" + domain="[('consolidated', '=', True)]"/> + <group string="Group By" expand="1"> + <filter string="User" name="group_by_user_id" + context="{'group_by': 'user_id'}"/> + </group> + </search> + </field> + </record> + + <record id="gamification_karma_tracking_view_tree" model="ir.ui.view"> + <field name="name">gamification.karma.tracking.view.tree</field> + <field name="model">gamification.karma.tracking</field> + <field name="arch" type="xml"> + <tree string="Trackings"> + <field name="user_id"/> + <field name="tracking_date"/> + <field name="old_value"/> + <field name="new_value"/> + <field name="consolidated"/> + </tree> + </field> + </record> + + <record id="gamification_karma_tracking_view_form" model="ir.ui.view"> + <field name="name">gamification.karma.tracking.view.form</field> + <field name="model">gamification.karma.tracking</field> + <field name="arch" type="xml"> + <form string="Tracking"> + <sheet> + <group> + <field name="user_id"/> + <field name="tracking_date"/> + <field name="old_value"/> + <field name="new_value"/> + <field name="consolidated"/> + </group> + </sheet> + </form> + </field> + </record> + + <record id="gamification_karma_tracking_action" model="ir.actions.act_window"> + <field name="name">Trackings</field> + <field name="res_model">gamification.karma.tracking</field> + <field name="view_mode">tree,form</field> + </record> + + <menuitem id="gamification_karma_tracking_menu" + parent="gamification_menu" + action="gamification_karma_tracking_action" + sequence="50"/> + </data> +</odoo> |
