diff --git a/addons/gamification/data/gamification_karma_rank_data.xml b/addons/gamification/data/gamification_karma_rank_data.xml index f86b827cceb..5eba07b1a3d 100644 --- a/addons/gamification/data/gamification_karma_rank_data.xml +++ b/addons/gamification/data/gamification_karma_rank_data.xml @@ -14,8 +14,8 @@

You just began the adventure! Welcome!

-
Reach the next rank to show the rest of the world you exist!
- +
Earn your first points and join the adventure !
+
1 @@ -27,8 +27,8 @@

You're a young padawan now. May the force be with you!

-
Reach the next rank to improve your status.
- +
Reach the next rank to show the rest of the world you exist.
+
100 @@ -40,8 +40,8 @@

You love learning things. Curiosity is a good way to progress.

-
Reach the next rank and become a Master!
- +
Reach the next rank to improve your status!
+
500 @@ -53,8 +53,8 @@

You know what you are talking about. People learn from you.

-
Reach the next rank and become a powerful user!
- +
Reach the next rank and become a Master!
+
2000 @@ -66,7 +66,8 @@

You have reached the last rank. Congratulations!

-
You have reached the last rank. Congratulations!
+
Reach the next rank and become a powerful user!
+
10000 diff --git a/addons/gamification/data/gamification_karma_rank_demo.xml b/addons/gamification/data/gamification_karma_rank_demo.xml index 6250ee227f6..839e8750047 100644 --- a/addons/gamification/data/gamification_karma_rank_demo.xml +++ b/addons/gamification/data/gamification_karma_rank_demo.xml @@ -1,5 +1,5 @@ - + 20 @@ -39,7 +39,7 @@
-
You have reached the last rank. Congratulations!
+
Reach the next rank and gain a very nice unicorn !
diff --git a/addons/gamification/models/res_users.py b/addons/gamification/models/res_users.py index daa9d4bc1e1..a0ca65ced45 100644 --- a/addons/gamification/models/res_users.py +++ b/addons/gamification/models/res_users.py @@ -96,6 +96,14 @@ class Users(models.Model): if old_rank != user.rank_id: user._rank_changed() + def _get_next_rank(self): + """ For fresh users with 0 karma that don't have a rank_id and next_rank_id yet + this method returns the first karma rank (by karma ascending). This acts as a + default value in related views. + + TDE FIXME in post-12.4: make next_rank_id a non-stored computed field correctly computed """ + return self.next_rank_id or (not self.rank_id and self.env['gamification.karma.rank'].search([], order="karma_min ASC", limit=1)) + def get_gamification_redirection_data(self): """ Hook for other modules to add redirect button(s) in new rank reached mail diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml index 9aac0a4376d..c28712f06ac 100644 --- a/addons/website_profile/views/website_profile.xml +++ b/addons/website_profile/views/website_profile.xml @@ -258,12 +258,11 @@
-
- Next rank: - - 40% - -
+ + Next rank: + + 40% + @@ -315,17 +314,21 @@