Purpose ======= Some users found a way to farm karma points, so we want to be able to track the source of the karma gain / loss. Specifications ============== Now, we added a reference field `origin_ref` which store the record responsible for the karma gain / loss (e.g. a slide we just completed). In addition to this origin, we also have a new field to store the reason (e.g. "Slide completed") so we know exactly what happened and how the user gains his karma. Before, the `old_value` of the karma tracking has to be set manually, but now it's done automatically based on the value of the previous tracking of the same user. That way, it will simplify other part of the code. Add the karma reason in the website modules. Adapt those modules due to the changes in gamification. Task-2234179 closes odoo/odoo#76430 Related: odoo/enterprise#23702 Related: odoo/upgrade#3299 Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com> Co-authored-by: std-odoo <std@odoo.com>
81 lines
4.3 KiB
XML
81 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo><data noupdate="1">
|
|
<!--Karma-->
|
|
<record id="karma_tracking_user_root" model="gamification.karma.tracking" forcecreate="0">
|
|
<field name="user_id" ref="base.user_root"/>
|
|
<field name="new_value">2500</field>
|
|
<field name="reason">I am the Root!</field>
|
|
</record>
|
|
<record id="karma_tracking_user_admin" model="gamification.karma.tracking" forcecreate="0">
|
|
<field name="user_id" ref="base.user_admin"/>
|
|
<field name="new_value">2500</field>
|
|
<field name="reason">I am the Admin!</field>
|
|
</record>
|
|
|
|
<!--Ranks-->
|
|
<record id="rank_newbie" model="gamification.karma.rank">
|
|
<field name="name">Newbie</field>
|
|
<field name="description" type="html"><p>You just began the adventure! Welcome!</p></field>
|
|
<field name="description_motivational" type="html">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-grow-1">Earn your first points and join the adventure !</div>
|
|
<img class="ms-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_newbie_badge.svg"/>
|
|
</div>
|
|
</field>
|
|
<field name="karma_min">1</field>
|
|
<field name="image_1920" type="base64" file="gamification/static/img/rank_newbie_badge.svg"/>
|
|
</record>
|
|
|
|
<record id="rank_student" model="gamification.karma.rank">
|
|
<field name="name">Student</field>
|
|
<field name="description" type="html"><p>You're a young padawan now. May the force be with you!</p></field>
|
|
<field name="description_motivational" type="html">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-grow-1">Reach the next rank to show the rest of the world you exist.</div>
|
|
<img class="ms-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_student_badge.svg"/>
|
|
</div>
|
|
</field>
|
|
<field name="karma_min">100</field>
|
|
<field name="image_1920" type="base64" file="gamification/static/img/rank_student_badge.svg"/>
|
|
</record>
|
|
|
|
<record id="rank_bachelor" model="gamification.karma.rank">
|
|
<field name="name">Bachelor</field>
|
|
<field name="description" type="html"><p>You love learning things. Curiosity is a good way to progress.</p></field>
|
|
<field name="description_motivational" type="html">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-grow-1">Reach the next rank to improve your status!</div>
|
|
<img class="ms-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_bachelor_badge.svg"/>
|
|
</div>
|
|
</field>
|
|
<field name="karma_min">500</field>
|
|
<field name="image_1920" type="base64" file="gamification/static/img/rank_bachelor_badge.svg"/>
|
|
</record>
|
|
|
|
<record id="rank_master" model="gamification.karma.rank">
|
|
<field name="name">Master</field>
|
|
<field name="description" type="html"><p>You know what you are talking about. People learn from you.</p></field>
|
|
<field name="description_motivational" type="html">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-grow-1">Reach the next rank and become a Master!</div>
|
|
<img class="ms-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_master_badge.svg"/>
|
|
</div>
|
|
</field>
|
|
<field name="karma_min">2000</field>
|
|
<field name="image_1920" type="base64" file="gamification/static/img/rank_master_badge.svg"/>
|
|
</record>
|
|
|
|
<record id="rank_doctor" model="gamification.karma.rank">
|
|
<field name="name">Doctor</field>
|
|
<field name="description" type="html"><p>You have reached the last rank. Congratulations!</p></field>
|
|
<field name="description_motivational" type="html">
|
|
<div class="d-flex align-items-center">
|
|
<div class="flex-grow-1">Reach the next rank and become a powerful user!</div>
|
|
<img class="ms-3 img img-fluid" style="max-height: 72px;" src="/gamification/static/img/rank_doctor_badge.svg"/>
|
|
</div>
|
|
</field>
|
|
<field name="karma_min">10000</field>
|
|
<field name="image_1920" type="base64" file="gamification/static/img/rank_doctor_badge.svg"/>
|
|
</record>
|
|
</data></odoo>
|