summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-04-05 12:51:21 +0200
committerThibault Delavallée <tde@odoo.com>2018-04-10 11:00:41 +0200
commitbcc6884737a0e172fb436dfcc199e5e1155fdc60 (patch)
tree8f2d1ea413e06ac16670127fcdfdefdce1a18ead /addons/web/static/src/xml/base.xml
parent26d110c4727d3c423672044164a51c02671d2797 (diff)
[IMP] mail: limit cache invalidation when subscribing followers
Cache invalidation when subscribing people has been added at e6f038a8216c249a3ce7d9f490010d9f666f3375. Indeed subscribing partners to a record may lead to an access right update as some of them are based on followers. This is why a cache invalidation is necessary to avoid access rights issues. However subscribing people to a record should change their rights only on the records involved in the subscription mechanism. We can therefore give ids to the cache invalidation to limit to updated records. Cache invalidation is also limited when writing on followers if writing on model, res_id or partner_id fields. Indeed changing subtypes or channel of a subscription should have no impact on cache and access rights. Cache invalidation done manually in _message_subscribe is not necessary as subscription create or update mail.followers records since f9c210923d89aeabfc358fdc7b8bd76df8c23ce8. Create and write of mail.followers records already ask for cache invalidation. It is therefore not necessary to invalidate cache twice. This commit allows to save a few queries on some tests, notably about activities that deal with subscription and messages. As cache is now kept it is not necessary to refetch some data, leading to a few query gain. We gain about 1K queries on com runbot. A side effect of limiting cache invalidation is that some unit tests require a manual cache invalidation to have up to date results. Indeed record not being up to date in cache was hidden by the invalidation we just removed.
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
0 files changed, 0 insertions, 0 deletions