diff options
| author | Thibault Delavallée <tde@odoo.com> | 2018-04-03 15:42:41 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-04-03 17:47:26 +0200 |
| commit | 1eba78381d0b8053d6244dbc0025018aa66c7ac1 (patch) | |
| tree | 4c19f29c8e6aabb9494541d78439be969916883d /doc/reference/javascript_cheatsheet.rst | |
| parent | b6d2351df45bdd049e42e828743b5dd2f1941649 (diff) | |
[REF] mail: improve implementation of auto subscription
This commit refactors mail.thread message_auto_subscribe method. Purpose
of this method is to automatically subscribe people to documents in several
scenarios
* followers from an umbrella record to sub-records, like followers of project
added to tasks;
* responsible of documents, in addition to sending notifications to newly
added responsibles;
* some specific use case depending on some applications like managers
for expense reports;
New auto subscription now uses the recently introduced method optimized to
compute new or to-update followers. It is also rewritten so that overriding
it is easier. Indeed simply overriding _message_auto_subscribe_followers is
now sufficient to add new followers to a record, depending on some updated
values. It is also now possible to specify a template to use for some
specific notification, if requested.
Fetching auto-subscription data in subtype is also optimized. It is now done
in a single SQL query. All data related to parent (like project) and child
(like task) as well as default and internal-only data is prepared in a single
query and given back to auto subscription process. This allows to gain
queries in auto subscription based on subtype like project / task use case.
This commit has a great impact on performance counters. Complex use cases
involving tracking and responsible notifications gain about 30 queries which
is about 15% of their total query count.
Diffstat (limited to 'doc/reference/javascript_cheatsheet.rst')
0 files changed, 0 insertions, 0 deletions
