Commit Graph
150 Commits
Author SHA1 Message Date
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
Denis Ledoux 02174099e2 [FIX] gamification: goal definition for models without inherits
When attempting to define a goal
using a model that does not have any `inherits`
- which happens most the time-,
it was not possible to choose the
`Field to Sum` and the `Date Field`,
due to the domain set in the view
which is no longer working in 9.0.

The domain is no longer working because:
 - The onchange result for a one2many for which
 the value is set to `[(6, 0, [])]` is now `[]`,
 while, in 8.0, the tuple with the command `6` and the empty
 list was preserved
 - the empty list `model_inherited_model_ids` is considered as `True` by py.js,
  and therefore it fallbacks to `model_inherited_model_ids[0]`, but
  as this is an empty list, it crashes.

The solution proposed in this revision solves the issue, while
making the domain applied on these fields less fragile.

opw-658892
2015-12-09 16:39:24 +01:00
Martin Trigaux e256262b0e [MERGE] Forward-port 9.0 up to 422f3b5d 2015-10-07 16:42:33 +02:00
Martin Trigaux eb18cad599 [FIX] gamification: avoid name clash with update
update is a method from the ORM with a different signature.
Avoid name clash. Issue 646610
2015-10-07 16:29:00 +02:00
Martin Trigaux b776d66d85 [FIX] all: ressource -> resource
Courtesy of Kris Krnacs
2015-10-01 10:54:04 +02:00
Miku Laitinen c9163c5403 [FIX] gamification: Made gamification badge descriptions translatable
The badge name is already translatable but the description was not,
Regenerate .pot file for these modules.

Closes #8399
2015-09-30 14:44:35 +02:00
Olivier Dony 94a0bbed0a [IMP] res.users: move login_date info to extra table
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-30 03:02:45 +02:00
Raphael Collet 5a6e136172 [IMP] addons: adapt binary fields to store images in attachments 2015-09-28 15:19:47 +02:00
Yenthe f804b06278 [FIX] gamification: Typo rewared > rewarded 2015-09-07 12:50:15 +02:00
Christophe Simonis edeceba7df [MERGE] forward port of branch saas-6 up to 7a768a4
Due to `sale` rewrite (94716a3f14),
the commit 503820acb6 has been partially
ignored (in sale.order.line) and will be rewritten later using new-api.
2015-08-28 15:07:16 +02:00
Christophe Simonis 6d85a9a4b9 [MERGE] forward port of branch 8.0 up to d744923 2015-08-27 18:30:46 +02: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
Thibault Delavallée 2c36354ca9 [RENAME] mail, website_mail, website_mail_group, various: mail.group
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-07-09 11:12:50 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- 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-06-02 03:16:04 +02:00
Christophe Simonis 3206a35aed [MERGE] forward port of branch 8.0 up to 8ac8281 2015-04-13 12:07:58 +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
Ravi Gohil 2acad60391 [FIX] gamification: translatable email notification
This requires a manual update/migration for existing template. opw 619786
2015-01-21 12:30:34 +01:00
Christophe Simonis 4ccca49d34 [MERGE] forward port of branch 8.0 up to 592f1cd 2015-01-21 12:11:38 +01: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
Goffin Simon 0fd773a486 [IMP] Cleanup and refactoring of exception handling
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-16 17:15:18 +01:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
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
2015-01-07 18:01:58 +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