summaryrefslogtreecommitdiff
path: root/addons/gamification/models/challenge.py
AgeCommit message (Collapse)Author
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-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-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-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-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).
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-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-27[FIX] gamification: avoid sending blank emailsFabien Pinckaers
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 9.0 up to e8b965fChristophe Simonis
2016-03-16[MERGE] forward port of branch saas-6 up to 1431ba2Christophe Simonis
Also include 2939800ed438505be9c919d4edca0ce624e6bf8e which seems to have been forgotten during previous forward-ports
2016-03-11[MERGE] forward port of branch 8.0 up to a0c5cf6Christophe Simonis
2016-03-10[FIX] gamification: close challenge after expirationMartin Trigaux
Before this patch, the challenges with an end date in the future were closed at the first cron run. opw-669995
2016-01-13[MERGE] Forward-port 9.0 up to rev. 3be9d911c0d50cbe6e4e5768d40011849cc43972Olivier Dony
2016-01-13[FIX] all: construction of translations lookupMartin Trigaux
When evaluated, the translation function never finds a match if a variable is integrated into the untranslated text. SHAME! :bell: :raising_hand:
2015-12-22[FIX] typo, EnglishMartin Trigaux
2015-10-07[MERGE] Forward-port 9.0 up to 422f3b5dMartin Trigaux
2015-10-07[FIX] gamification: avoid name clash with updateMartin Trigaux
update is a method from the ORM with a different signature. Avoid name clash. Issue 646610
2015-10-01[FIX] all: ressource -> resourceMartin Trigaux
Courtesy of Kris Krnacs
2015-09-30[IMP] res.users: move login_date info to extra tableOlivier Dony
Writing frequently to master data, and particularly to res.users records is dangerous because it can temporarily delay/abort concurrent transactions due to FK locking/serializability heuristics. (Even with PostgreSQL 9.3+) The `login_date` field updated when a user is authentiocated is still useful but better handled in a separate table that exclusively receives independent INSERTs (no UPDATE/DELETE). This minimizes the chances of transactional conflicts. This commit moves the login_date info into a separate `res.users.log` table for this purpose, replacing it with a related field. The user and login date info are automatically handled by the magical fields (create_uid, create_date) in `res.users.log`. The related field must not be stored because that would create the same problems as the original field. In order to cleanup redundant entries in res.users.log the 'auto-vacuum' cron job used for TransientModels was extended to be a generic "internal data vacuum cleaner", and now takes care of this as well. The code for updating last login and vacuuming was split up into smaller methods to make extensions easier. Fixes #8585 Fixes #8590
2015-09-07[FIX] gamification: Typo rewared > rewardedYenthe
2015-08-28[MERGE] forward port of branch saas-6 up to 7a768a4Christophe Simonis
Due to `sale` rewrite (94716a3f14d929574c46ef165e4364d12a5903ed), the commit 503820acb6d82a85c0c49ac26f7e7f8cd73851dd has been partially ignored (in sale.order.line) and will be rewritten later using new-api.
2015-08-27[MERGE] forward port of branch 8.0 up to d744923Christophe Simonis
2015-08-27[FIX] gamification: Refresh ChallengeGoffin Simon
When clicking on the button "Refresh Challenge" in the "gamification.challenge" view form, all the "gamification.goal" records linked to this challenge must be updated. opw:647983
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.
2015-06-02[LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate textOlivier Dony
- Preserved explicit 3rd-party copyright notices - Explicit boilerplate should not be necessary - copyright law applies automatically in all countries thanks to Berne Convention + WTO rules, and a reference to the applicable license is clear enough.
2015-04-13[MERGE] forward port of branch 8.0 up to 8ac8281Christophe Simonis
2015-04-07[FIX] gamification: Start Date and End Date formatGoffin Simon
In the function start_end_date_for_period, in the "else" clause, the case considered for the period is "once". In this case, start_date and end_date are either False or in string format. opw: 631941
2015-01-21[MERGE] forward port of branch 8.0 up to 592f1cdChristophe Simonis
2015-01-20[FIX] gamification: fetch results is a tupleMartin Trigaux
2015-01-20[IMP] gamification: performance improvementMartin Trigaux
Reduce the number of goals that are recomputed. Remove the goals for users that did not connect since the last update. Add sql query for faster lookup and restrict on user table
2015-01-16[IMP] Cleanup and refactoring of exception handlingGoffin Simon
Unify and refactor exception handling in framework and addons. The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes: - `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration. - `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights. - `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request. - `MissingError`: raised when an operation is attempted on a record that does not exist. - `ValidationError`: raised when an operation violates a SQL or Python constraint. - All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback. All exceptions take a single message argument. The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions. A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages. This commit introduces a more consistent policy for logging errors and warnings: - All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations. - All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention. - All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
2015-01-07[IMP] Mass mailings send in cronJulien De Coster
1. The merge of the "email_template" module into the "mail" module. 2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view. 3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing). 4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail. 5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign. 6. Many little improvements
2014-10-07[IMP] gamification: avoid sending twice emails in cronMartin Trigaux
When the cron is running on a database with a large number of goals (e.g. website_forum with thousands of users), it's possible the CPU time is exceeded and we may have a rollback after sending some emails (for granted badges). To avoid sending twice emails, commit in cron mode after each reward.
2014-09-18[IMP] gamification: usability and shitMartin Trigaux
Challenge - 'Reward as soon as every goal is reached' box checked by default (most of the time people want this behaviour, few special cases were do not) - Click on challenge kanban opens goal list instead of challenge form - Add button 'Start Challenge' clicking on statusbar is not intuitive Badge - When creates a challenge from badge view, set by default badge to 'For Every Succeding User' field - replace filter 'Current' vs 'Passed' by 'Running' (in progress and done with not reached end date) vs 'Done' (done & failed without end date or end date passed) Goal - list of badge on employee form not the first tab
2014-08-04[FIX] gamification: prevent traceback in goals historycod-odoo
Closes #1536
2014-07-06[MERGE] new v8 api by rcoRaphael Collet
A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes
2014-06-19[MERGE] forward port of branch saas-5 up to adf07a9Christophe Simonis
2014-06-19[MERGE] forward port of branch saas-4 up to 5087612Christophe Simonis
2014-06-19[MERGE] forward port of branch saas-3 up to bf53aedChristophe Simonis
2014-06-17[FIX] GAMIFICATION: Fixed the Attribute ErrorParamjit Singh Sahota
' 'str' object has no attribute 'strftime' '
2014-06-02[IMP] gamification: remove deprecated methodMartin Trigaux