Purpose
=======
Some users found a way to farm karma points, so we want to be able to
track the source of the karma gain / loss.
Specifications
==============
Now, we added a reference field `origin_ref` which store the record
responsible for the karma gain / loss (e.g. a slide we just completed).
In addition to this origin, we also have a new field to store the
reason (e.g. "Slide completed") so we know exactly what happened and
how the user gains his karma.
Before, the `old_value` of the karma tracking has to be set manually,
but now it's done automatically based on the value of the previous
tracking of the same user. That way, it will simplify other part of
the code.
Add the karma reason in the website modules. Adapt those modules due
to the changes in gamification.
Task-2234179
closesodoo/odoo#76430
Related: odoo/enterprise#23702
Related: odoo/upgrade#3299
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Co-authored-by: std-odoo <std@odoo.com>
How to reproduce
=================
Give a badge to an employee, when checking the sent mail, The image and
description of the badge is nowhere to be seens.
Those fields don't display because the description contains P html tags.
The presence of the removed `t-if` is the main cause of the issue.
Adding a `not` to the condition solves the issue. This not was lost
during the Jinja -> Qweb translation (commit 68182ba)
opw-3099419
closesodoo/odoo#114259
X-original-commit: c90add64f91667d5c9f2294029aa674b19981278
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
is ignored, except for the kanban view which has a custom
way of using it.
- The optional "js_class" attribute set on the root node of a view arch
does not have any impact on the class names passed to its controller.
**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in
<list class="o_custom_class">
...
</list>
as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in
<list js_class="extended_list">
...
</list>
will both be found in the prop "className" of any view controller.
[1] a js_class value of "xyz" yields to the class "o_xyz_view"
**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.
closesodoo/odoo#113014
Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Before this commit, the comment field in the view_badge_wizard_grant form is
displayed with a long with higher width and thus it appears with scroll bar in
the screen.
How to reproduce
Go to Settings -> Gamification Tools -> Badges
Click Grand on any badge
After this commit, the comment field will properly align in the form.
closesodoo/odoo#111412
X-original-commit: 69eb431cea959270d3fb2f12ec9dbb451750ce06
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Display goal description and definition field full width. Purpose is to have
well aligned fields, using v16 new rendering options.
closesodoo/odoo#106489
X-original-commit: e676d88ef5e6601f8e986ee25f99395907b8d2aa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Using patcher.start() can easily lead to incorrect cleanup.
-> after a copy paste, patcher is working, but stop is forgotten
-> stop is present, but won't be called if something fails during the
test
This commit add an utility `start(patcher)` to always have the add
cleanup.
Using a standard way to start the patcher with an automated addCleanup
should prevent this kind of mistake. This is why this commit also
replaces all valid patch.start() (followed immediately by a addCleanup)
closesodoo/odoo#102873
X-original-commit: 7d5a193d86316965a0908c65cfacfb607dc3f3ad
Related: odoo/enterprise#32618
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Allow our users to modify mail template more easily
- make the list accessible from the settings
- give them a link to update relevant views to update header/footer
- make the list and form of templates more readable
- add a description on templates, allowing to describe their usage
In order to better filter templates, a new category field is added that
is computed based on active flag, description being set and the template
having an xml ID. Master templates are active, with a description and an
xml ID.
Update master data to add description on some templates.
task-2944770
closesodoo/odoo#101730
X-original-commit: dfa867343ee8842f3f127ac62584fd471b41dde1
Related: odoo/enterprise#32079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Gamification code is currently using ``message_post_with_view`` a bit weirdly
* on a not mail-thread enabled record (using model / res_id propagated to
composer which allows it);
* using mass mail composition mode (aka creating directly mail.mail);
* based on a template;
This is basically achieved with ``template.send_mail()`` method.
Task-2710804 (Mail: Clean MailThread API)
Part-of: odoo/odoo#100137
This commit will make date(time) raw_value an ISO string
instead of a native JS Date.
- Before this commit
In kanban templates:
- the raw_value property of a record's date/datetime field is
a native JS Date object.
The problem with raw_value is that JS Dates toString
method depends on the system locale and timezone.
In the code base, the usage of raw_value for date/datetime fields
usually parse the raw_value into a luxon DateTime object
in order generally to display it in a specific format, or in order
to compare it to another luxon DateTime object (e.g. the now instant).
- After this commit
The raw_value property of a record's date/datetime field
has become an ISO8601 string, instead of native JSDate toString
format (which I recall depends on system's locale and timezone).
The ISO8601 format is easier to work with.
Part-of: odoo/odoo#98980
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
fields having a tooltip in the future UI.
4/ some cleanup of existing messages too
The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX
closesodoo/odoo#97279
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
'name' field not present in 'gamification.goal' model
which causes error while rendering mail template such that
object 'gamification.goal' has no attribute 'name'
opw-2844136
closesodoo/odoo#92300
Closes: https://github.com/odoo/odoo/pull/91439
X-original-commit: 0a1970e218527440debb8c75fff2fa47de5e2677
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The kanban view was recently improved to add the support of 'action' and
'type' attributes on the kanban arch. This commit takes advantage of
that change to simplify a few views in various addons.
Part-of: odoo/odoo#92071
Purpose
=======
Avoid calling _recompute_rank for users that are not affected by the
newly created/written ranks, by filtering users by karma_min
Task-2746929
closesodoo/odoo#89463
X-original-commit: 3a0562ea809b5ba40a66fa4a996424696320f91c
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Purpose
=======
Avoid sending lost of emails for new ranks rank for each user when
installing gamification module.
Emails are now only sent outside of module installation.
Task-2746929
X-original-commit: 5dc3b3ef794b78f18713b4bcf6254ab60d62eec4
Part-of: odoo/odoo#89463
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases
closesodoo/odoo#84908
Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)
Review of indexes on all objects.
closesodoo/odoo#83015
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
PURPOSE
Gamification display is slow when being heavily used. Indeed the m2m towards
users is used in kanban and form views, leading to a huge data fetch when
being used in production environment with lots of users.
SPECIFICATIONS
Remove user_ids m2m from views. Indeed in some heavily used DBs you may have
more than 10K records in user_ids, leading to a huge m2m tags to display.
Replace it by an optimized count, used in
* form view: as a stat button redirecting to participants of a challenge;
* kanban view: a line (replacing the 11 first avatars) redirecting to
participants of a challenge;
Task-2678295
Part-of: odoo/odoo#79599
Purpose of this commit is to rename and reorder data by main model. It
allows to better understand module organization and find data one may have
to update.
Task-2678295
Part-of: odoo/odoo#79599
Purpose of this commit is to rename and reorder models by main model. It
allows to better understand module organization and find models one may have
to update.
Task-2678295
Part-of: odoo/odoo#79599
Purpose of this commit is to have all gamification menus defined in a single
file. It helps reorganizing a module TOC (menus) when doing some b2b like
on an app. Otherwise menus are split across several files and finding them
and keeping them organized is not easy.
Task-2678295
Part-of: odoo/odoo#79599
Purpose of this commit is to rename and reorder views by main model. It
allows to better understand module organization and find views one may have
to update.
Task-2678295
Part-of: odoo/odoo#79599
RATIONALE
Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.
SPECIFICATIONS
On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.
On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.
In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.
Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
Part-of: odoo/odoo#76418
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment
By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).
There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).
We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.
To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.
This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
(for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
in order to see only one at once
- a floating select input to switch visibility of a particular logical
branching
Task-27033
X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
`fields.Date.today` doesn't give date based on TZ which might be wrong
in some cases as it doesn't respect TZ.
With this commit, we are using `fields.Date.context_today` as default date.
closesodoo/odoo#76241
X-original-commit: addd4ae73ca4fa7a7046a88dd1310361dd895f15
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of this commit is to globally improve code performance by limiting
search impact by using cache when accessing ir.model.
Note that tests are left untouched as they are generally done using admin
(or at least data preparation is done as admin). Diff is kept small currently.
Task-2638444
PR odoo/odoo#76005
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Define `data-hotkey` on most used action buttons.
For the modals, the following keys are dedicated for "special"
actions:
- Alt+G: add
- Alt+V: save
- Alt+Z: cancel
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Add HTML fields support to kanban view (currently bespoke but maybe it
should be done via `format`), and remove t-raw for HTML fields there.
Also just strip some t-raws which were completely unnecessary to start with
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).
In this commit we replace report_footer and report_header field of
"base.document.layout, res.config.settings" model as
they are related fields of res.company models field
report_footer, report_header.
Task Id: 2499504
X-original-commit: 4c474d0d2055efe81fdc21502aa5957fe80af7ef
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.
Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient
Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.
closesodoo/odoo#69819
Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>