Commit Graph
177 Commits
Author SHA1 Message Date
Christophe Simonis ef6b574eda [MERGE] forward port branch saas-11.3 up to 6cc7d3f945 2018-08-21 18:48:13 +02:00
Christophe Simonis fbfb91799e [MERGE] forward port branch saas-15 up to 9cf0dbe226 2018-08-21 16:00:40 +02:00
Christophe Simonis aafa6e38c4 [MERGE] forward port branch 10.0 up to 342d037373 2018-08-21 11:33:53 +02:00
Grzegorz Krukar 48b492b086 [FIX] gamification: correctly set computed values
Field incorrected named
Introduced at 0c64964

Closes #25307
2018-08-20 09:10:20 +02:00
XavierDo c8d283a592 [FIX]: mail: storing add_sign on mail message
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-07-11 12:25:33 +02:00
Pratima Gupta 2e2aaa218e [IMP] gamification: make email templates bioutifoul
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-06-08 15:38:49 +02:00
Joren Van Onder a91512daf6 [FIX] gamification: support large amounts of goals in update_goals
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
2018-05-02 16:01:50 -07:00
Christophe Simonis 30bd5ac0e9 [MERGE] forward port branch saas-16 up to aec6248bb3 2017-08-23 16:44:58 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
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-20 23:25:54 +02:00
Martin Trigaux 88dfcfd025 [FIX] gamification: remove leftover debugger 2017-08-17 16:42:06 +02:00
rar-odoo 7e24143b35 [FIX] gamification: challenge winner (#18901)
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-08-17 16:30:48 +02:00
Xavier Morel 07ab8b6cd2 [FIX] P3: Exception.message removed 2017-05-12 16:15:40 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
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-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* 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-28 09:06:53 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* 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-27 13:59:33 +02:00
Xavier Morel 3979f6802e [#8530] convert exception handlers to except..as syntax
Futurize fixers:
* lib2to3.fixes.fix_except
2017-04-11 14:53:29 +02:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Nicolas Lempereur 83b6b71e29 [FIX] gamification: user_domain issue with not all
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 0c649644db 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
2017-02-13 12:34:58 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Thibault Delavallée 56645335b7 [IMP] gamification: improve email sent when granting a badge
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-30 10:46:12 +01:00
Fabien Pinckaers 347494c06b [FIX] gamification: avoid sending blank emails 2016-12-27 15:28:01 -08:00
Jeremy Kersten 26c7ff9118 [FIX] gamification: don't use multimode from render_template
If render_template get list and not id, a dict is returned.
Force the param to be a int, allow to don't use the multimode from render_template.

Avoid to get message like:
 <p>{1: u'\n        </p><p>Congratulation, you have received the badge <strong>Autobiographer</strong> !\n        </p>\n\n'}
 <p>{2: u'\n        </p><p>Congratulation, you have received the badge <strong>Autobiographer</strong> !\n        </p>\n\n'}
 <p>{3: u'\n        </p><p>Congratulation, you have received the badge <strong>Student</strong> !\n        </p>\n\n'}
 <p>{4: u'\n        </p><p>Congratulation, you have received the badge <strong>Supporter</strong> !\n        </p>\n\n'}
2016-09-22 18:17:55 +02:00
dut-odoo 8972bbd226 [FIX] gamification: goal definition: traceback when changing model
* self.model_id is already a recordset, no need to re-browse it
* id are expected in domain, not recordset

oversight from rev 0c649644db
2016-08-18 21:31:48 +02:00
Thibault Delavallée 8b6f7e1fe6 [FIX] various: fix fields index parameter in new API still called select 2016-08-09 12:28:03 +02:00
Xavier Morel c736465dab [MIG] gamification: compute_code data and evaluation 2016-08-05 10:18:02 +02:00
Xavier Morel 0c649644db [MIG] gamification: Migrate to new API
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-08-05 10:18:02 +02:00
Xavier Morel c7a818caee [REM] gamification: res_users extensions
Apparently leftover from when features got removed from the client.
2016-08-05 10:18:02 +02:00
Christophe Simonis 413ba9445c [MERGE] forward port of branch 9.0 up to 24eebbd 2016-05-26 14:06:36 +02:00
Christophe Simonis 24eebbd25c [MERGE] forward port of branch saas-6 up to 6c6a9f3 2016-05-26 13:56:16 +02:00
Christophe Simonis aa220a5e03 [MERGE] forward port of branch 8.0 up to 6622196 2016-05-26 12:27:56 +02:00
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 5245dc5d9b [IMP] gamification: prevent misconfiguration
Do not allow to select field that will be used read_group but not stored in db

Fixes #8545
2016-05-25 12:10:50 +02:00
Christophe Simonis 59d3f63c58 [MERGE] forward port of branch saas-7 up to 9e4157b 2016-03-24 15:12:00 +01:00
Christophe Simonis 9e4157b648 [MERGE] forward port of branch 9.0 up to a2c5fe4 2016-03-24 15:10:36 +01:00
Christophe Matthieu bad14a54d3 [IMP] gamification: add sql index on 'gamification.badge.user' to improve speed of 'gamification.badge' function fields 2016-03-23 12:53:16 +01:00
Christophe Matthieu 2abc2ceee0 [IMP] gamification: split multi function field to avoid massive prefetching of user records
Issue: website_forum takes 15 to 30 seconds to load the user page
2016-03-23 11:22:51 +01:00
Christophe Simonis 1a3e807fc2 [MERGE] forward port of branch saas-7 up to 5238b77 2016-03-16 16:11:12 +01:00
Christophe Simonis 5238b77430 [MERGE] forward port of branch 9.0 up to e8b965f 2016-03-16 16:09:13 +01:00
Christophe Simonis a34d496069 [MERGE] forward port of branch saas-6 up to 1431ba2
Also include 2939800ed4 which seems to
have been forgotten during previous forward-ports
2016-03-16 15:30:03 +01:00
Christophe Simonis b59be87a18 [MERGE] forward port of branch 8.0 up to a0c5cf6 2016-03-11 14:12:58 +01: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
Christophe Simonis 78d20b552b [MERGE] forward port of branch saas-8 up to 7e44ddc 2016-01-27 12:24:04 +01:00
Olivier Dony 39bd21fc47 [MERGE] Forward-port 9.0 up to rev. 3be9d911c0 2016-01-13 17:13:05 +01:00
Martin Trigaux bb56e484b7 [FIX] all: construction of translations lookup
When evaluated, the translation function never finds a match if a variable is
integrated into the untranslated text.

SHAME! 🔔 🙋
2016-01-13 14:46:30 +01:00
Christophe Simonis 5ba5172d99 [MERGE] forward port of branch saas-8 up to 8064379 2016-01-07 15:16:56 +01:00
Martin Trigaux 34348ebf8d [FIX] typo, English 2015-12-22 11:58:47 +01:00
Martin Trigaux ab448abdc6 [IMP] gamification: remove unused field 2015-12-21 14:38:24 +01:00
Martin Trigaux c298cf3250 [MERGE] Forward port of 9.0 up to 7892d99f 2015-12-18 16:15:08 +01:00