summaryrefslogtreecommitdiff
path: root/addons/gamification/data
AgeCommit message (Collapse)Author
2020-12-11[IMP] gamification,gamification_sale_crm: compute goals using batch modeBenoit Socias
Trying to improve the resources used by the challenge update cron operation. Before this commit some count-based goals and all sum-based goals were computed with one select count or sum per user. After this commit each count or sum based goal is computed in a single select for all users. The goal form now also allows to enable batch mode for sum computations. Other changes include: - adding an index on the challenge_id of goals after verifying the positive impact of such an index on high volumes on a staging server - introducing additional intermediary commits to allow massive crons to catch up over several attempts. task-internal closes odoo/odoo#63030 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-19[FIX] gamification: fix karma tracking demo dataDavid Beguin
Before this commit, when checking the gained karma per month or per week in /profile/users route, the users gained more karma than they actually have. This is due to the way demo data are loaded : karma tracking history is added but when the final karma is set on the user, a new line of karma tracking is created on the DB (via write or create method). But as the transaction with karma tracking demo data is not commited yet, the old value is still 0. That leads to add a new karma tracking line that have old_value = 0 and new_value = user.karma. At the end the users 'gained' as addition the amount of the karma they have. E.g : Mitchell Admin has 2500 karma and his karma tracking history is the following: 0 -> 1000 then 1000 -> 1500 then 1500 -> 2500. In total, Mitchell should have gained 2500 XP: (2500-1500)+(1500-1000)+(1000-0) But, before this commit, as there is an additional 0 to 2500 karma tracking line, Mitchell Admin gain in total : (2500-0)+(2500-1500)+(1500-1000)+(1000-0) = 5000 karma. This commit clean that additional karma tracking line to get a correct karma tracking history. Task ID: 2209743 PR #48042 closes odoo/odoo#48061 X-original-commit: 858f80e2529b17d1857d77f372c378ae235443de Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-11[REF] mail, various: remove user_signature field from mail.templatemcm-odoo
RATIONALE Mail template model holds a field telling odoo mail engine to automatically add the current user's signature to the body. Its use depends on the use case * using the template in the composer on a single record: it is displayed in the rendered template in the composer, meaning people could change it. This behavior is interesting as it allows to see the email content; * using the template in the composer in mass mail mode: it is not displayed as only the raw jinja is displayed. It is therefore not obvious that it will be appended to the body of the mail. People could add it manually and have 2 signatures as a result; A mechanism automatically adding a signature to sent emails when posting a message is already implemented and is based on template existence. If a template has been used when posting, no signature is added in sent emails. Otherwise it is automatically added. This behavior should not change. Behavior will therefore be * use a template -> specify signature usage in it manually through jinja; * do not use a template -> signature added in sent emails; SPECIFICATIONS Remove user_signature. Update template body accordingly. In customer oriented templates that are using it and do not already contain it, manually add a call to user.signature within the jinja code. When set to False, just remove its declaration. Quickly clean some signature integration. LINKS Task ID 2089252 Community PR odoo/odoo#39482 Enterprise PR odoo/enterprise#6459 Upgrade PR odoo/upgrate#761 Related: odoo/enterprise#6459 Related: odoo/upgrade#761 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Co-authored-by: Michaël Mattiello <mcm@odoo.com> Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-02-11[IMP] *: use `ref=` instead of `eval="ref('` in xml field tags.Victor Feyens
* Code cleanup * Avoid a safe evaluation of the field value when loading those records. closes odoo/odoo#44883 Related: odoo/enterprise#8283 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-01-21[IMP] (website_)mail: improve routes and management of mail followersRémy Voet (ryv)
Purpose of this commit is to improve model of followers, notably management code and its use in routes. Indeed it is quite an old model and code had to be cleaned a bit to improve code readability and maintenance. In this commit we * remove unnecessary code examples in gamification about followers: using that model as example of code for goals is probably not a good idea as it is technical; * rewrite routes called by JS are simplified to better match JS implementation; * introduce computed fields to fetch related partner or channel name, email (partner only) and active status; LINKS Task 1933771 Task 2078313 closes odoo/odoo#39808 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Co-authored-by: Remy Voet <ryv@odoo.com> Co-authored-by: jgi-odoo <jgi@odoo.com> Co-authored-by: Xavier-Do <xdo@odoo.com>
2019-11-22[REF] gamification, * : rename challenge.category into ↵David Beguin
challenge.challenge_category To ease grep in the code, especially that challenge is quite heavily used. Task ID : 1961053 PR #32594
2019-11-05[IMP] gamification: track karma change on usersPatrick Hoste
PURPOSE Allow karma gain tracking enabling notably display of top users based on weekly / monthly gain in website profile. SPECIFCIATIONS Each time a user gains karma a record is created in the gamification karma tracking model. Scheduled activity runs to consolidate the records into monthly gain records to avoid having crowdy table and unnecessary noise in karma gain. This model is made private and only accessible through some dedicated compute methods / controllers used in website profile. In website profile module buttons are added to see users ranking based on their total karma (like before) but also by last week and last month gains (using the newly introduced tracking model). LINKS Task ID 2003505 PR #34594
2019-09-19[IMP] *: remove image_64 and clean viewsSébastien Theys
There are too many image sizes. Since they are stored resized this takes time to generate when saving a new image, it's more rows on the attachment table, more files on the disk, ... 64px is close enough to 128px that it can be removed without a big impact on download size. It will even reduce download and number of requests when both images are displayed because now only one has to be downloaded and then benefit from cache. The difference between the two is typically around 1.5kB which is negligible these days, especially when the request overhead is around 0.5kB already, not even taking into account other factors such as latency. If a 64px image must absolutely be returned, it is still possible to pass the size parameters to the image route. But the current guideline is to handle resizing in the views when necessary. Views ===== - remove width and height attributes when existing CSS rules are overriding them (eg. `.oe_kanban_avatar` in the right context) - add CSS rules instead of width and height attributes when possible - use `object-fit: cover;` where width and height are forced to avoid distortion of non-square images - for products, use `object-fit: contain;` instead, keep ratio but without crop - add new CSS rules where the expected size was max 64px*64px before due to the image size itself - remove `img-fluid` where using size classes to avoid conflicting rules task-2060865 closes odoo/odoo#36147 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-08-02[IMP] *: use image.mixin when appropriateSébastien Theys
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[IMP] *: rename image fieldsSébastien Theys
image_original => image_1920 (now resized to 1920) image_big => image_1024 image_large => image_256 image_medium => image_128 image_small => image_64 image replaced by image_1920 (when writing) or by image_1024 (when displaying what was previously the big size) + add new intermediate format: image_512 PR: #34925
2019-07-15[MERGE] Forward port of saas-12.4 to master up to 1f5a4649a67908Martin Trigaux
closes odoo/odoo#34850 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12[MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6a1823Martin Trigaux
closes odoo/odoo#34820 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-25[MERGE] forward port branch saas-12.3 up to 793933a1287Christophe Simonis
2019-06-20[FIX] gamification: restore broken images in non-demo dataqsm-odoo
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-28[FIX] gamification, website_{profile, slides}: correctly display next rankThibault Delavallée
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 489c8623e2c4869ce1ed8be3d186e36cc1c47456. 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-17[MERGE] forward port branch saas-12.3 up to 48a9f5a6335Christophe Simonis
2019-06-13[IMP] website_[profile,slides]: improve karma rank layoutAurélien Warnon
This commit improves the karma rank layout displayed on the courses home page and on the user profile. Task #2003222
2019-06-27[MERGE] forward port branch saas-12.4 up to 5e81b18e24aChristophe Simonis
2019-06-18[MERGE] forward port branch saas-12.4 up to 618ea1ab675Christophe Simonis
2019-06-17[IMP] *: remove 'view_type' on window actions.Hiral Bhavsar
The old tree views don't really exist anymore, this odd pseudo-flag to dispatch between "list" and "tree" tree views has no reason to remain. Task 1937686 closes odoo/odoo#31243 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-03-08[IMP] gamification : move rank demo data into dataDavid Beguin
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-06[FIX] gamification, website_profile : re-fix division by zero if user has no ↵David Beguin
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-02-21[FIX] gamification: improve next rank iconsThibault Delavallée
Background of icons should be transparent. Commit linked to task ID 1941250 and PR #31317.
2019-02-15[REF] gamification: clean next rank motivational implementationThibault Delavallée
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 91ee6ba5a72fc961227ab1e4ba301c3920c10112)
2019-02-15[IMP] gamification, website_slides: add challenges in slides and improve ranksThibault Delavallée
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-14[IMP] gamification,forum: remove deprecated alert when sending badgejem-odoo
Since 56645335b7bae0415242ec51193e493119a58879, when a user get a badge, an email is sent. The subtype is not used anymore, so the alert mecanism in forum to display a message to the user to show him his new badges can not work. This commit removes this dead code. Task-1922159
2019-02-12[MOV] gamification, website_forum : move karma data and demo in gamificationDavid Beguin
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-08[IMP] gamification : rename rank.karma_required into karma_min for grep ↵David Beguin
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-07[IMP] gamification : add ranks based on karmaDavid Beguin
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-04-23[FIX][IMP] various: perform small cleanup of mail templatesThibault Delavallée
Notably * remove cdata and fix html code when necessary; * re-order fields declaration to have globally the same order in various template definition; * remove unnecessary reply-to, make user signature and auto delete fields explicit when necessary; * improve some name to ease template ordering and understanding in the template list view; Related to task 1972615 Linked to PR #32872 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-23[FIX][IMP] various: improve recipients computation in mail templatesThibault Delavallée
Purpose: use more email_formatted when possible, clean and simplify email_from, email_to and partner_to computation. Next step is to try to extract some common patterns in tools or methods in order to simplify template creation and customization. Related to task 1972615 Linked to PR #32872
2018-11-02[FIX] gamification: correct mail template on small challengesMartin Trigaux
A challenge with less than 3 participants was failing with a key error The challenge line has only one 'goal' result per participant As the template is set in a noupdate, even a module update does not fix the bug Generate fake goals that will be displayed in the top 3, e.g.: 1 Bob $100 42% 2 Alice $50 21% 3 0 0% closes odoo/odoo#28363
2018-10-03[ADD] *: replace hardcoded data URIs with helperPedro M. Baeza
- Add a method for generating an image data URI, and expose it in QWeb context - Fix reports, website templates or mail templates with data hardcoded data URIs, to use the helper (Python cases), or the existing kanban_image helper (for JS cases) This will gracefully handle SVG support in addition to classical image formats. Closes #26635
2018-08-06[IMP] base: improve kanban of modules, cards not clickable (top-right menu)Fabien Pinckaers
[NEW] base: show enterprise module, with an 'upgrade' button [IMP] *: some modules renaming, and improved copywriting of manifest [IMP] *: utm on links to odoo.com
2018-06-08[IMP] gamification: make email templates bioutifoulPratima Gupta
Purpose of this commit is to enhance quality of templates proposed by Odoo and make them use notification layout when send by emails. Those emails are cleaner and more up to date compared to other emails. Including * calls to message_post now use the light notification layout. It is given as parameter to the message_post process; * some cleaning in templates; This commit is related to task ID 51122 (and PR #24052).
2017-08-02[FIX] Gamification: email template (#18331)rar-odoo
* [FIX] Gamification: email template - realized that the pictures of users were not public by default, which means src with an url won't work if not connected to the database. This is fixed by embedding the pictures directly in the mail. * [FIX] Gamification: challenge template - fixed layout problems with what works in the renderer.
2017-07-17[FIX] gamification: email template for challenges (#18265)rar-odoo
* [IMP] Gamification: email template - new template for challenges for both personal and ranking mode.
2017-01-03[REF] ir_cron: make scheduled actions inherits from server actionsThibault Delavallée
The purpose of this commit is to handle code execution only in server action and delegate schedule management to ir_cron model. ir.cron model now inherits from ir.actions.server. Fields model, function and args are removed as well as the logic to handle them. There is no more code manipulation and evaluation in ir_cron, only a call to the run method of ir.actions.server. Cron form view use server action form view as primary view. This way automated actions use the same base form as server actions with cron details added. Thanks to @fpodoo for the original idea and preliminary work. Thanks to @jpr-odoo for first developments. Thanks to @jem-odoo for reviewing.
2017-01-03[IMP] web, *: add new Domain and Field selection widgetsqsm-odoo
* base_action_rule, gamification, mass_mailing 1) Create the independant DomainSelector widget - Allow to build a prefix char domain 2) Replace old FieldCharDomain with a new FieldDomain which uses the new DomainSelector widget 3) Create the independant ModelFieldSelector widget - Allow to build a valid field chain for a specific model (e.g 'partner_id.name' for a 'res.users') - Used by DomainSelector widget --- The DomainSelector widget uses a tree-like representation with user-friendly buttons (ALL/ANY/+/-/...). Any domain can be built, except those containing the "!" (not) operator or some operators like "like", "child_of" (@see DomainSelector). However, if the user enters these in the debug input, the widget can handle them. Note: these widgets had to do unusual stuff the widget API does not allow to handle efficiently right now but it will be adapted to the new widget/field API in a further update. Note2: the widgets also have possibility of other improvements like supporting m2o input instantiation in DomainLeaf, etc. --- This work is an adaptation of the original code made by @pga-odoo.
2016-12-30[IMP] gamification: improve email sent when granting a badgeThibault Delavallée
Give some details about the badge: its description, its image, who granted it, ... Otherwise it is quite complicated to understand the email content. Thanks to @mart-e who reviewed and tested.
2016-08-05[MIG] gamification: compute_code data and evaluationXavier Morel
2016-08-05[MIG] gamification: Migrate to new APIXavier Morel
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-03-16[MERGE] forward port of branch saas-7 up to revision ↵qdp-odoo
71d16a369e01515aac988c62371d70549d3b5294
2016-03-11[MERGE] forward port of branch 9.0 up to 8e69043Denis Ledoux
2016-02-29[FIX] gamification: missing model in email templateDenis Ledoux
Therefore, the template could be seen from the Discuss module, when clicking on "Send Mail", but, when attempting to use it, it failed (as it was not applied on the right model). opw-670546
2016-01-05[FIX] gamification: force empty context for actionChristophe Simonis
The context has been removed by commit abf30a7f15eea2589d9f5c65668667efb0dff472 but need to be forced as empty for existing databases.
2015-11-20[REM] Get rid of the ugly 'default_groups_ref' context keyYannick Tivisse
Because it is useless now with the new behavior brought by the previous commit. All the necessary details are explained in this one.
2015-11-02[IMP] various: template updateJamin Shah
Templates have been updated to remove most of the styling and simplify them. Some workding has also be done.
2015-07-09[RENAME] mail, portal: updated actions and views xml idsThibault Delavallée
for channel-related stuff. mail.channel views as well as timeline views and actions have been renamed. Now the names follow the guidelines and will be used in the upcoming refactoring of mail and chat.
2015-07-09[RENAME] mail, website_mail, website_mail_group, various: mail.groupThibault Delavallée
model has been renamed to mail.channel to prepare the slack modeling. In future commits the mail.group model will be merged with the channel model from im_chat. The first move is to rename mail.group into mail.channel to have a model that will unite both features.