summaryrefslogtreecommitdiff
path: root/addons/base_setup
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2020-03-05 09:13:58 +0000
committerDavid Beguin <dbe@odoo.com>2020-03-19 17:22:06 +0000
commitc06a7cf2de9e2278780e0a210294c4ed3e053d37 (patch)
treea33ebaabc6cad47c64eb87eaa6612805392c38be /addons/base_setup
parent71af8ee4f831afc08910f459548fd6a95a81ed73 (diff)
[FIX] gamification: fix karma tracking demo data
Before this commit, when checking the gained karma per month or per week in /profile/users route, the users gained more karma than they actually have. This is due to the way demo data are loaded : karma tracking history is added but when the final karma is set on the user, a new line of karma tracking is created on the DB (via write or create method). But as the transaction with karma tracking demo data is not commited yet, the old value is still 0. That leads to add a new karma tracking line that have old_value = 0 and new_value = user.karma. At the end the users 'gained' as addition the amount of the karma they have. E.g : Mitchell Admin has 2500 karma and his karma tracking history is the following: 0 -> 1000 then 1000 -> 1500 then 1500 -> 2500. In total, Mitchell should have gained 2500 XP: (2500-1500)+(1500-1000)+(1000-0) But, before this commit, as there is an additional 0 to 2500 karma tracking line, Mitchell Admin gain in total : (2500-0)+(2500-1500)+(1500-1000)+(1000-0) = 5000 karma. This commit clean that additional karma tracking line to get a correct karma tracking history. Task ID: 2209743 PR #48042 closes odoo/odoo#48061 X-original-commit: 858f80e2529b17d1857d77f372c378ae235443de Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/base_setup')
0 files changed, 0 insertions, 0 deletions