Commit Graph

114 Commits

Author SHA1 Message Date
Martin Trigaux 37bbe87d57
[INP] gamification: skip check for not required fields
Could get a definition with a model only
2016-05-26 08:33:20 +02:00
Martin Trigaux a4687c6e42
[FIX] gamification: bad backport to 8.0
UserError was defined in version 9, not 8
2016-05-26 08:30:51 +02:00
Martin Trigaux 97492a12a9
[IMP] gamification: prevent misconfiguration
Prevent selecting wrong field or models or computed fields

Fixes #8545
2016-05-25 14:58:55 +02:00
Martin Trigaux abe5859559 [FIX] gamification: close challenge after expiration
Before this patch, the challenges with an end date in the future were closed at
the first cron run.

opw-669995
2016-03-10 09:26:17 +01:00
Goffin Simon 96be5b404a [FIX] gamification: Refresh Challenge
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-08-27 16:41:52 +02:00
Goffin Simon b1dd5d6045 [FIX] gamification: Start Date and End Date format
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-04-07 08:55:05 +02:00
Martin Trigaux 79e01f0f4d [FIX] gamification: fetch results is a tuple 2015-01-20 16:15:10 +01:00
Martin Trigaux ec0c0f2973 [IMP] gamification: performance improvement
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-20 14:42:56 +01:00
Martin Trigaux fb8dc5793b [FIX] gamification: translate string 2015-01-20 13:57:10 +01:00
Christophe Simonis 2e3f59181d [MERGE] forward port of branch saas-3 up to db75994 2014-10-14 15:13:14 +02:00
Martin Trigaux ea68690407 [IMP] gamification: avoid sending twice emails in cron
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-10-07 18:14:57 +02:00
Denis Ledoux f305b9e95b [FIX] gamification: on delete badge user, cascade
Otherwise, this is no more possible to delete users having badges
2014-10-07 10:24:57 +02:00
Denis Ledoux 2c25fa2dc4 [MERGE] forward port of branch saas-3 up to 56f678c 2014-10-07 09:59:55 +02:00
Denis Ledoux 56f678c8e9 [FIX] gamification: on delete goal user, cascade
Otherwise, this is no more possible to delete users with gamification goals
2014-10-07 09:57:35 +02:00
Thibault Delavallée 7cad4baa84 [FIX] [CLEAN] Various: fixed / cleaned use of dict.fromkeys.
Indeed using fromkeys with a list / dict as argument leads to the creation
of shared list / dict. This could create some ugly side effects when
used in loops. This commit fixes or cleans this kind of statement to avoid
unwanted side effects.
2014-09-18 11:18:30 +02:00
Martin Trigaux f0c3856be2 [IMP] gamification: allow to select fields of inherited models 2014-09-18 11:12:15 +02:00
Martin Trigaux 56b3db8219 [IMP] gamification: usability and shit
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-09-18 11:12:15 +02:00
Martin Trigaux e95aeb659c Forward port of branch saas-5 up to 9a7f48a 2014-09-02 14:50:51 +02:00
Martin Trigaux b707719891 [IMP] gamification: improve 40e8437 to make only one global request 2014-09-02 11:25:02 +02:00
Martin Trigaux 40e843761f [FIX] gamification: performance improvement
On a large database, thousands of badges may have been granted. This code used to prefetch all fields of the users and badge users. This was highly inefficient. Replace this code by SQL query.
2014-09-01 17:40:47 +02:00
Olivier Dony e11eddf753 [MERGE] Forward-port of saas-5 up to 20cc18d 2014-08-13 20:46:47 +02:00
Olivier Dony 2a94d1d811 [MERGE] Forward-port saas-4 up to 2694ed1 2014-08-13 17:34:27 +02:00
Olivier Dony 2694ed1472 [MERGE] Forward-port saas-3 up to b9275da 2014-08-13 17:33:12 +02:00
Olivier Dony 7aa0376f3e [FIX] gamification: prohibitive record rule processing with many users/goals
Due to the multi-company record rule on gamification.goal,
each access to the Goals menu and each opening of the
Messaging menu (thus calling get_serialised_gamification_summary())
is extremely slow (with several thousands goals/users).

Adding auto_join to the user_id FK on goals makes it much
faster. However it causes crashes when reading the table
because the _order of gamification.goal uses `create_date`,
which becomes ambiguous after the auto_join with res_users.

Solving this can be done by re-implementing _read_flat()
in the ORM using the internal Query object, as in search(),
which takes care of fully-qualifying all column names.

Until this is fixed, a simple workaround is to use
start_date in the _order instead of collision-prone `create_date`.
2014-08-13 13:47:50 +02:00
cod-odoo fca77ad8c5 [FIX] gamification: prevent traceback in goals history
Closes #1536
2014-08-04 11:37:26 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
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-07-06 17:05:41 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Christophe Simonis eef6330c55 [MERGE] forward port of branch saas-5 up to adf07a9 2014-06-19 16:23:32 +02:00
Christophe Simonis adf07a9490 [MERGE] forward port of branch saas-4 up to 5087612 2014-06-19 16:13:35 +02:00
Christophe Simonis 5087612d1d [MERGE] forward port of branch saas-3 up to bf53aed 2014-06-19 15:44:07 +02:00
Paramjit Singh Sahota 9bb0abd641 [FIX] GAMIFICATION: Fixed the Attribute Error
' 'str' object has no attribute 'strftime' '
2014-06-17 15:12:15 +02:00
Olivier Dony 0f01df42ea [MERGE] Forward-port saas-5 up to f15cbd6 2014-06-12 18:59:15 +02:00
Olivier Dony f15cbd6520 [MERGE] Forward-port saas-4 bugfixes up to ad4c6ca 2014-06-12 18:54:36 +02:00
Christophe Simonis 7bee9447c4 [MERGE] forward port of branch saas-3 up to 3c7a54a 2014-06-11 11:06:04 +02:00
Martin Trigaux 387093a34a gamification: when changing the domain on a goal definition give a simple check to avoid getting a traceback when the challenge is reloaded 2014-06-10 12:03:32 +02:00
Christophe Simonis a5908c5812 [MERGE] forward port of branch saas-5 up to b1c0bc0 2014-06-03 20:02:00 +02:00
Christophe Simonis b1c0bc0b46 [MERGE] forward port of branch saas-4 up to 65f68c1 2014-06-03 19:45:19 +02:00
Martin Trigaux aa1165441c [FIX] gamification: do not group on agregated field for sum
The read_group behaviour has changed and read_group no longer sum on the field you are grouping.
Instead agregate on the field we want to sum and use no groupby.
For future version, grouping on a user such as what is done in batch mode is a better way to process.
2014-06-03 10:48:26 +02:00
Martin Trigaux ae8e7ea920 [IMP] gamification: remove deprecated method 2014-06-02 15:15:53 +02:00
Christophe Simonis a756b82372 [MERGE] forward port of branch saas-4 up to revid bb26dea 2014-05-20 20:19:55 +02:00
Martin Trigaux 8f2bbf73ae [FIX] gamification: avoid sending reports for non-reported challenges 2014-05-14 16:15:18 +02:00
Martin Trigaux ce5ba45d45 [IMP] gamification: avoid fetching function field while we could reuse the cache system of the browse records (avoid memory errors when updating a large number of records) 2014-05-14 15:41:38 +02:00
Martin Trigaux 0043a58763 Forward-port of latest saas-3, up to revision 9456 (yep I missed one commit) 2014-05-14 11:01:36 +02:00
Martin Trigaux 3ff7b48a81 [FIX] gamification: make sure than a cron running more than once a day will not report the progress more than once 2014-05-14 10:59:20 +02:00
Martin Trigaux 583fe74ba2 Forward-port of latest saas-3, up to revision 9455 (rev-id mat@openerp.com-20140514080416-m4t23y0rxx2ot7y6) 2014-05-14 10:37:54 +02:00
Martin Trigaux f14f632ef5 [IMP] gamification: improve the name of some m2m relations
bzr revid: mat@openerp.com-20140512092718-s6143ajy2g18ofy4
2014-05-12 11:27:18 +02:00
Martin Trigaux 3691ee0ca7 [FIX] gamification: avoid challenge to be initialised at the target limit (e.g. set your company data goal has a target of 0) and make sure we will compute the goal at least once
bzr revid: mat@openerp.com-20140509131839-lm5zt696sif1krvx
2014-05-09 15:18:39 +02:00
Martin Trigaux fd50793820 [IMP] gamification: avoid subscription hacks and send directly relevant messages to followers of the challenge, remove the goals of users not matching the user domain anymore
bzr revid: mat@openerp.com-20140507095616-1xvetgj4qel7iqii
2014-05-07 11:56:16 +02:00
Martin Trigaux 3fa2751855 [FIX] name_get returns tuple
bzr revid: mat@openerp.com-20140506143834-od28gkhbpbhsgde4
2014-05-06 16:38:34 +02:00
Martin Trigaux 3cdb9803d4 [IMP] unsubscribing at each cron run is overkill
bzr revid: mat@openerp.com-20140506135953-3hssq2lycvy1c3df
2014-05-06 15:59:53 +02:00