diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-08-23 16:44:58 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-08-23 16:44:58 +0200 |
| commit | 30bd5ac0e904906d90f4767bbbf178bf940c0c66 (patch) | |
| tree | ea271d0f46ed35c8af460aa71890c1dce474d2a4 /addons/gamification/models | |
| parent | 7f2bd086087f73878f62933ecd2e7c2bed32142e (diff) | |
| parent | aec6248bb379c1ece02f5d4f718566c770fc2c6f (diff) | |
[MERGE] forward port branch saas-16 up to aec6248bb37
Diffstat (limited to 'addons/gamification/models')
| -rw-r--r-- | addons/gamification/models/challenge.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 8a1b02d65fe..140576da889 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -503,8 +503,10 @@ class Challenge(models.Model): line_data['own_goal_id'] = False, line_data['goals'] = [] - - goals = Goals.search(domain, order="completeness desc, current desc") + if line.condition=='higher': + goals = Goals.search(domain, order="completeness desc, current desc") + else: + goals = Goals.search(domain, order="completeness desc, current asc") for ranking, goal in enumerate(goals): if user and goal.user_id == user: line_data['own_goal_id'] = goal.id |
