Commit Graph
10 Commits
Author SHA1 Message Date
Jeremy Kersten 8a80efd7cd [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>
2019-07-24 09:03:13 +00:00
Christophe Monniez 3ff0948b0a [FIX] gamification: compute badge stats wihtout error
Since 960360a, when computing badge stats, a datetime was compared to a
string leading to a traceback.  e.g. when clicking in employess >
badges.

Also, due to a typo, the compute method was assigning the stats result
to the wrong attributes.  e.g. 'stats_my_this_month' instead of
'stat_my_this_month'.

With this commit, the above mentioned issues are fixed and a test is
covering these issues to avoid regression.
2018-08-22 09:28:16 +02:00
Xavier Morel 0c649644db [MIG] gamification: Migrate to new API
Includes compatibility-change to website_forum: a selection(callable)
converted to a Selection(list) since that can easily be extended in the
new API.
2016-08-05 10:18:02 +02:00
Martin Trigaux eb18cad599 [FIX] gamification: avoid name clash with update
update is a method from the ORM with a different signature.
Avoid name clash. Issue 646610
2015-10-07 16:29:00 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Xavier Morel 65cd4a2a33 [FIX] remove deprecated checks/fast_suite test attributes from standard modules 2015-01-15 14:31:40 +01:00
Martin Trigaux 36acee7568 [FIX] gamification: test needs cron to run
bzr revid: mat@openerp.com-20140416153153-f6r85uc8ibztzvup
2014-04-16 17:31:53 +02:00
Martin Trigaux 90ebde3676 [FIX] gamification: remove old calls to action_close
bzr revid: mat@openerp.com-20131224152902-i2ozrf41y1ou2vdm
2013-12-24 16:29:02 +01:00
Martin Trigaux 13bfaef3a3 [FIX] gamification: remove old calls to action_start
bzr revid: mat@openerp.com-20131224151543-oofn9wc2w3933gjy
2013-12-24 16:15:43 +01:00
Martin Trigaux e7887b8b8f [REF] gamification: python tests and other improvements
bzr revid: mat@openerp.com-20131218111243-npnauv6mxhb4nttg
2013-12-18 12:12:43 +01:00