Files
odoo_source/addons/mail/controllers
Alexandre Kühn ad45817435 [PERF] mail: no memoryerror from slow load_message_failures
Earlier PR improved ACLs in Discuss [1].

Route `/mail/load_message_failures` was made in non-sudo as to take
ACLs into account, so that we don't get mail failures that we don't
have access [2]

However, checking ACLs on `mail.message` from `search` on
`mail.notification` is very slow [3], to the point where the RPC
takes minutes and results in a `memoryerror`.

Ideally we should have non-sudo and make checking ACLs more
performant. As a quick fix in a stable version, we revert to using
`sudo`, which results in same quick results as before.

[1]: https://github.com/odoo/odoo/pull/138330
[2]: https://github.com/odoo/odoo/pull/138330/files#diff-6be51f3695e69474a19cf6857370c8bb9b529a15d568952258cec9a0ae519fc4R23
[3]: https://github.com/odoo/odoo/blob/17.0/addons/mail/models/res_partner.py#L251

closes odoo/odoo#146184

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-12-13 17:12:02 +00:00
..
…
…