One clock icon can take down an instance
The activity systray (the clock in the top bar) loads on every page. Standard Odoo 16 pulls all of the current user’s scheduled activities into memory and filters them with an O(n²) membership test. When an automated rule has quietly piled hundreds of thousands of activities onto one user — a common failure mode on aged databases — that user’s activity menu takes minutes, pins a worker and returns 504 Gateway Timeout, degrading the whole instance.
One fast query instead of the whole table
Grouped SQL aggregate
The overdue / today / planned badges are computed with a single indexed COUNT(*) FILTER per model. The activity table never enters Python.
Record rules, in SQL
Each model’s record rules are compiled and pushed into the query’s WHERE clause, so the badge counts only what the user may read — multi-company included.
Identical result shape
The returned data structure — keys, per-model dictionaries, the actions entry — is identical to standard Odoo, so the menu renders exactly as before.
Check in ten seconds
Run this read-only query. If any single user has tens or hundreds of thousands of activities on one model, that menu is the bottleneck this module fixes.
SELECT u.login, a.res_model, count(*)
FROM mail_activity a JOIN res_users u ON u.id = a.user_id
GROUP BY u.login, a.res_model
ORDER BY count(*) DESC LIMIT 10;
Who it’s for
Any Odoo 16 database that has accumulated a large mail.activity table — typically from long-running automated actions — and whose activity menu has become slow or throws 504 timeouts for some users.
Questions, answered
No. Permissions, buckets and result shape are all preserved; the automated tests assert exact parity with standard Odoo.
Yes. The multi-company record rule is compiled into the SQL, so counts are correct per company.
Yes — investigate the automated action that created them. This module makes the menu fast regardless, but a runaway rule will keep growing the table.
Standard behaviour returns. There is no schema change to reverse.
Odoo 16.0 · License OPL-1 · No Enterprise modules required
Documentation-first — the built-in manual (this page &
doc/index.rst) covers install, verification and troubleshooting, so you can run it without a support subscription.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module