summaryrefslogtreecommitdiff
path: root/addons/gamification/models
AgeCommit message (Collapse)Author
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-03-15[IMP] website_profile, gamification, : add search bar in all users pageDavid Beguin
This commit adds the search bar in 'All users' page in order to filter on name or company name. To be able to keep the position, a non stored computed field has been added on res_users to get the position depending on the user's karma. The podium (top 3 users) is now displayed only if there is no search applied and if the page = 1 because it has no sens anymore in other cases. Special thanks to @jem-odoo who helped me finding smart solution for position computing. Task ID : 1943788 PR #31321
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-03-08[MERGE] forward port branch saas-11.3 up to ecd8c023b7cChristophe Simonis
2019-03-08[MERGE] forward port branch saas-15 up to 21c84f15322Christophe Simonis
2019-03-08[MERGE] forward port branch 10.0 up to 88de9311416Christophe Simonis
2019-03-06[FIX] gamification: badge auth for badge no errorSuganthi Karunanithi
To avoid exception: TypeError: Mixing apples and oranges: gamification.badge() - gamification.badge.user(1,) when rule_auth of a badge is set to `having`. opw-1945440 closes #31436 closes #31595 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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-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-14[IMP] gamification, website_forum : apply various improvementsDavid Beguin
- add menu to configure ranks in gamification tools because was missing - move admin karma data in gamification : karma linked to gamification and not forum anymore - fix rank computation : next_rank_id could never been recomputed correctly if rank are created in a karma ascending order. Task ID : 1922159 PR #30988
2019-02-12[FIX] gamification: fix rank computationDavid Beguin
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-02-07[REF] gamification, website_forum: move karma, badge and badge level to ↵David Beguin
gamification Purpose of this commit is to prepare addition of gamification in slides / eLearning platform. In order to be able to use karma and the badges in other modules we move those models in gamification. 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-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-31[FIX] gamification: add space in generated queryRomainLibert
The generated query in _generate_goals_from_challenge lacked spaces between the date clause, which caused a traceback. The traceback only appears since v12 and above, because the dates are now casted as dates (::date) in SQL, which has to be followed by a space. Before that it was "fine" as SQL does allow you to write g.start_date = '10-10-2017'and g.end_date = '11-11-2017' Closes #28773 closes odoo/odoo#29836
2018-11-29[REF] *: replace deprecated pycompat helpers for builtinsAdrian Torres
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
2019-01-09[MERGE] forward port branch saas-12.1 up to 8aa8548d8abChristophe Simonis
2019-01-04[REF] various: update tracking parametersThibault Delavallée
Purpose is to clean the use of tracking parameters on fields. Parameters are merged and is now tracking=<int> or tracking=True. This commit is linked to task ID 1903814 and PR #28430.
2018-12-07[CHG] *: make binary fields default to attachment=TrueXavier Morel
Check that it makes custom binary fields into attachment as that's the main reason for the change: when users create binary fields via Studio, they're necessarily db-stored (as the interface doesn't allow altering the attachment attribute and it's unclear how we'd handle users switching it on/off every time), which significantly bloats their database (and burns storage & backup space), especially as the primary use case for binary fields is adding images and documents to records. * check that binary fields are properly created as attachment=True * add attachment=False on fields where that seems relevant (most but not all of the fields previously using the default) * remove occurrences of attachment=True closes odoo/odoo#29308
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-02[IMP] mail: Make mail.compose.message code more readableYannick Tivisse
Purpose ======= Remove the method 'render_template' in mail.compose.message as the indirection is not useful. Call the method on the correct model (mail.template) directly.
2018-09-27[REF] *: adapt code to new related default behaviourAdrian Torres
This commit adapts the business code to changes introduced by the parent commit in order to keep the same behaviour as before. All readonly=False fields will have to be checked afterwards to confirm that the business case requires write access to the source field.
2018-09-21[IMP]hr_*: Improvement in model descriptionNimesh Jethva
Purpose of this commit is to give description more "business oriented" because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers. Related Task ID : 37311
2018-09-11[FIX] models: make log_access fields readonly, and remove useless definitionsRaphael Collet
2018-08-22[FIX] gamification: compute badge stats wihtout errorChristophe Monniez
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-21[MERGE] forward port branch 10.0 up to 342d0373732Christophe Simonis
2018-08-20[FIX] gamification: correctly set computed valuesGrzegorz Krukar
Field incorrected named Introduced at 0c64964 Closes #25307
2018-08-06[REF] *: use native date/datetime for Date/Datetime fieldsRaphael Collet
From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master. This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well. Task-ID: 47189
2018-08-21[MERGE] forward port branch saas-15 up to 9cf0dbe2267Christophe Simonis
2018-07-16[MERGE] forward port branch saas-11.4 up to 8285630ad26Christophe Simonis
2018-07-16[IMP] de-commit-ify db/module installXavier Morel
Try to remove cr.commit (and rollback) from module and db install: * put a savepoint around test data loading * remove a bunch of commits sprinkled throughout * remove rollback on data loading failure (assuming it bubbles up, the entire module's installation should be rolled back) * add commit right before the tests are run, so they can run isolated and still see whatever was done when installing their module * convert a few explicit closing to context managers
2018-07-11[FIX]: mail: storing add_sign on mail messageXavierDo
Only the add_sign from notif_values is usefull for a resend. We can consider that a mail on resend can be delete in every case, and we can find the model_description from model since a resend can only be performed on message linked to a model. The other notif_values are now parameter in order to ease the understanding of what can transit through this flow. Task: #1860054 PR: #25622
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).
2018-05-02[FIX] gamification: support large amounts of goals in update_goalsJoren Van Onder
update_goals is called through the 'Run Goal Challenge Checker' cron, potentially on a large amount of goals. With self containing ~400k records a worker has been observed to use ~3.4 GiB. With sensible memory limits this will probably cause the worker to be killed. To avoid this turn of prefetching in this initial loop. Performance shouldn't be affected too much because in the following loop prefetching for goals will still take place per definition. opw-1840666
2017-08-23[MERGE] forward port branch saas-16 up to aec6248bb37Christophe Simonis
2017-08-20[FIX] P3: remove pycompat.{keys,items,values} helpersOlivier Dony
Now that we're closer to switching to P3 for good, these helpers have outlived their usefulness, and mostly add noise. All remaining dict.iter*() or dict.view*() must be converted to the normal keys(), values() or items() calls. Whenever the result is likely to be used for more than the scope of a loop, or when the dict needs to be modified during iteration, the calls must be wrapped in a ``list()``, to protect the new P3 semantics. Those cases are very exceptional. Also removed some dead code or improved the API to remove unnecessary conversions.
2017-08-17[FIX] gamification: remove leftover debuggerMartin Trigaux
2017-08-17[FIX] gamification: challenge winner (#18901)rar-odoo
In the curent behaviour, the users of the challenge are ordered regardless of the goal definition (higher wins or lower wins). This impacts the report email with the podium of users and always puts higher on top. This fix changes the ordering depending on the goal definition type.
2017-05-12[FIX] P3: Exception.message removedXavier Morel
2017-05-10[FIX] P3: list -> iterable builtins (#16811)xmo-odoo
In Python 3: * various builtins and dict methods were changed to return view/iterable objects rather than lists * and the separate Python 2 view/iterable builtins and methods were removed altogether This is problematic when using these items as list (which the happens repeatedly in Odoo), but more viciously when iterating *multiple times* over them (which also happens, which I've messed up multiple times while writing this, and which is a pain to debug even when you've just created the issue). Convert all code using these to semantics-matching cross-version helper functions to get the LCD behaviour between P2 and P3, and forbid the builtins via lint. issue #8530
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* LDAP import: python-ldap is not python3-compatible, pyldap is Warning: only supported from debian Stretch (current testing)? https://packages.debian.org/search?searchon=names&keywords=pyldap * implicitly relative imports * imports of moved or removed stdlib modules issue #8530
2017-04-27[FIX] builtins removed from Python 3xmo-odoo
* Reverse wrapper courtesy of @rco-odoo's original P3 branch * thin compat module stripped down from werkzeug (to augment as needed) issue 8530
2017-04-11[#8530] convert exception handlers to except..as syntaxXavier Morel
Futurize fixers: * lib2to3.fixes.fix_except
2017-02-23[MERGE] forward port branch 10.0 up to 387b2acfcbfChristophe Simonis
2017-02-13[FIX] gamification: user_domain issue with not allNicolas Lempereur
The field user_domain allow to get the list of users for which a challenge is applied. The javascript framework for a char_domain widget sends a JSON list to the server, but the server saved it as a string in a Char field. Hence we can have a list (in values received by write or create) or a string (when getting the field value of a record). Since 0c649644db0 this caused an error when user_domain was not empty. This commit solves it by having _get_challenger_users always receiving a string. opw-708177
2016-12-30[MERGE] foward port of 10.0 up to revision ↵qdp-odoo
84a650e33aadb29661121410813e3de37a5ad3e9
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-12-27[FIX] gamification: avoid sending blank emailsFabien Pinckaers