Commit Graph
10 Commits
Author SHA1 Message Date
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Thibault Delavallée cd039b64d4 [FIX] gamification, website_{profile, slides}: correctly display next rank
This fix correctly displayed motivational of next rank to achieve depending
on current karma. Indeed description_motivational field is not the
motivational to reach next rank but to reach the current rank, taken from
previous rank point of view. That way a given rank is configured by modifying
only 1 data.

When not having any karma points (newly created user) the next rank is computed
as being the first available rank. Motivational phrases and badges are updated
accordingly. This commit partially reverts 489c8623e2.

Result

  * new user with no karma: next rank is the first rank;
  * user with karma and next rank: as currently;
  * user being at final rank: next rank is just current rank with a 100%
    circle;

Linked to task 2005840
Related to PR #34220
2019-06-28 13:45:33 +00:00
qsm-odoo 8401c6bfac [FIX] gamification: restore broken images in non-demo data
For some strange reasons, the e-learning ranks are created in data but
the demo data override their motivational message fields.
Unfortunately, the demo data were ok but the normal data had broken
images in them.

closes odoo/odoo#34282

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-20 12:42:06 +00:00
David Beguin 523c1276a1 [IMP] gamification : move rank demo data into data
In order to se the 'next rank card' and the user karma on user's profile page,
not only the first rank is needed but also higher ranks. Otherwise everyone
will be 'Newbie', even the admin.

Moreover it is easier to update existing data for things like rank than having
to figure out how it works.

Task ID : 1941250
PR #31697
2019-03-08 11:15:07 +00:00
David Beguin 1949c796b5 [FIX] gamification, website_profile : re-fix division by zero if user has no karma
If a new user try to access the elearning platform or his porfile, if he has
no karma, has it is the case for new users, he won't get any rank. So that
the next rank karma minus current rank karma equals zero.

To avoid this, next_rank will always be first one existing if the user has no
karma. Also, the current rank will not be displayed if the user has no karma.
finally, next rank will not be displayed if the user reached the last existing
rank.

Task ID : 1941250
PR #31512
2019-03-06 14:08:24 +00:00
Thibault Delavallée e7b3535884 [REF] gamification: clean next rank motivational implementation
Purpose of this commit is to clean motivational capabilities of gamification
ranks[1]. It makes more sense to store a motivational to achieve on next rank
itself. We therefore rename the field and provide nice demo data that will be
used in elearning use of gamification ranks.

Commit linked to task ID 1941250 and PR #31133.

[1] task ID 1922159 (landed at 91ee6ba5a7)
2019-02-15 17:45:11 +00:00
Thibault Delavallée c971b622c0 [IMP] gamification, website_slides: add challenges in slides and improve ranks
Purpose of this commit is to add challenges related to slide / elearning
module. 5 new challenges with their badges are added. Portal user partner
is now also published to have bioutifoul demo data. Commit linked to
eLearning tasks [1][2]

Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>

[1] new homepage task: ID 1936153 and PR #30770
[2] new user profile / gamification task: ID 1922159 and PR #30514 and #30988
2019-02-15 09:57:46 +00:00
David Beguin b0aa6f654b [MOV] gamification, website_forum : move karma data and demo in gamification
As gamification karma-based features can be used outside of forum let us
move demo and data directly in gamification. It will be used notably for
eLearning.
2019-02-12 11:23:34 +00:00
David Beguin b9902d961e [IMP] gamification : rename rank.karma_required into karma_min for grep convenience
Rename rank.karma_required into karma_min to avoid confusion
with karma_required from website_forum

Linked to Task ID : 1922159
Closes PR #30965
2019-02-08 18:03:29 +00:00
David Beguin 9e082662af [IMP] gamification : add ranks based on karma
To encourage forum and slides users to be more active ranks are now added.
They are directly linked to karma. The more the user has karma the more his
rank will be high.

The default rank is Newbie, with 1 point of karma. Users with 0 karma are
considered as inactive on forum or slides. When a user reach a new rank
a mail is sent to him to congratulate him with his new rank.

To add a button in the mail template to allow users to go directly on
a website section (like forum or slides) simply override
get_gamification_redirection_data to add the target url.

Partial commit linked to eLearning project. Main specifications related
to gamification and user profile can be found on task 1922159 (PR #30514).
Main specifications related to eLearning can be found on task 1902304
(PR #29876).
2019-02-07 12:13:28 +00:00