Commit Graph
4 Commits
Author SHA1 Message Date
Paul Morelle 37e9dda232 [FIX] digest: avoid exception on user creation
Scenario to reproduce the issue on runbot 12.0 Community:
- Go to Settings > Technical > Email > Digest Emails
- Select the Weekly Digest
- Click on Action > Delete
- Click on OK
- Go to Settings > Users & Companies > Users
- Click on Create
- Fill the Name and the Email Address
- Save
- Odoo Server Error - Missing Record

Some users seem to delete this record to stop receiving the digest for
everyone, including for future users.  The problem is that, even if the
digest has been deleted, the config parameters are still referencing it.

This commit prevents the exception by having an empty recordset if the
digest does not exist.

closes odoo/odoo#73237

X-original-commit: 2910bd24f410e882b9745337f918a206b25925f7
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2021-07-05 14:18:07 +00:00
Victor Feyens 0279cbc4a7 [IMP] base: compute users share in batch.
Instead of triggering one has_group by user (one sql query/user if not already ormcached),
and potentially filling the `has_group` cache with new users data (we don't know if and when this data
will be used anyway), compute this field from the groups information already in cache.

X-original-commit: d771d7e9c8503543d29fdbf2ab961c2a32cc3bac
2020-04-27 12:00:45 +02:00
Victor Feyens e3c329b9bc [IMP] *: create users and partners in batch
The main classes of partners and users support batch creation, but
the majority of their overrides doesn't support creation in batch.

Adapting those overrides to support records creation in batch shows
great performance gains:

* On `res_partner` : 2 to 3 times faster
* On `res_users`, with the inherited `res_partner` created in batch:
	up to 10 times faster.

Tests done with 500 to 4k records:

* `res_partner` with only a name provided
* `res_users` with a name and login

X-original-commit: 9c3c5f161580039c1fe50f68acac808c18817997
2020-04-27 12:00:45 +02:00
Mitali PatelandSiddharth Gajjar 2d1abe64e4 [ADD] digest: add new module to send recurrent digests by email
This commit adds a new digest module allowing to send recurrent digests by
email. Those contain a summary of the activity and display various KPIs
allowing to see the activity at a glance. It is also a great tool to improve
user engagement.

Digest module contain the core implementation of digests emails as well as
first basic KPIs. Future commits will gradually add KPIs in various main
addons.

Digests consist in email templates that have to call some methods on digest
module (compute_kpis, compute_tips, compute_kpis_actions) and render it
accordingly. A default digest is given in data allowing to tune it or to
duplicate and modify it.

Frequency is configurable on the digest; digests can be weekly, monthly or
send every 3 months. New employee users are added to the default widget.
KPIs are computed for each subscribed users so that results match its
groups and related access rights. Default digest therefore work for all users
as displayed results depend on their right without having to define separate
digests just for that purpose.

Implementation is done with Studio in mind. KPIs are computed fields on the
digest model. It means using Studio custom computed fields can be defined
to add customization to the digests, using fields named x_kpi_... .

Digests also holds tips to remind and warn users of features to activate
or configure like mailgateway.

KPIs can be linked to actions so that the section contain a link allowing
to directly jump on a given menu, allowing to directly link reporting
menus for example.

This commit is related Task ID 30655 and PR #18318.

Co-authored-by: Siddharth Gajjar <sga@odoo.com>
2018-07-19 11:26:45 +02:00