summaryrefslogtreecommitdiff
path: root/addons/gamification/tests/__init__.py
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2019-07-11 17:00:30 +0000
committerJeremy Kersten <jke@odoo.com>2019-07-24 09:03:13 +0000
commit8a80efd7cd9f564338c6ca6c72e49f6890190b4c (patch)
tree5cb228f1488e4b062a4ccec5adfccca4de2b25b6 /addons/gamification/tests/__init__.py
parent78b09d82fb16181c3ae2e4964f3cff30b76424db (diff)
[FIX] gamification: perf on write karma_min on gamification.karma.rank
This commits avoid to call recompute when you write on the rank without touch the karma_min value. On write on karma_min, we have 2 cases: - Rank order are the same, just need to recompute the rank for the user that could be impacted. Eg. if karma_min changes from 45 to 50, we need to recheck for all user between 45 and 50 their new rank. - Rank order are not the same, we need to recompute for all users. (could be still improved if needed) When you recompute the rank on a list of users, depending of the number of users (bulk if more than 3 * number of rank) we check for each user what is the new rank, or for each rank whats is the new users. task-internal No way to edit a rank on the prod server. Lock sql -> crash server closes odoo/odoo#34835 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/gamification/tests/__init__.py')
-rw-r--r--addons/gamification/tests/__init__.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/gamification/tests/__init__.py b/addons/gamification/tests/__init__.py
index 0219f6754d0..a6a599bf6c8 100644
--- a/addons/gamification/tests/__init__.py
+++ b/addons/gamification/tests/__init__.py
@@ -2,3 +2,4 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_challenge
+from . import test_recompute_rank