Skip to content

[FIX] gamification: Force goal updates for portal users#651

Open
JVegaB wants to merge 1 commit intoVauxoo:18.0from
vauxoo-dev:18.0-JVegaB-i4306-13042026
Open

[FIX] gamification: Force goal updates for portal users#651
JVegaB wants to merge 1 commit intoVauxoo:18.0from
vauxoo-dev:18.0-JVegaB-i4306-13042026

Conversation

@JVegaB
Copy link
Copy Markdown

@JVegaB JVegaB commented Apr 13, 2026

Before this commit, Odoo attempted to optimize the _update_all method in gamification.challenge by filtering users based on their recent activity in the bus_presence table.

While this optimization works for internal users who frequently trigger bus presence events by navigating the backend, it fails completely for portal users (e.g., donors or customers). Portal users can remain logged in and active on the website for long periods without ever generating a new last_presence event, causing their gamification goals to stall and stop updating.

This patch removes the bus_presence filters entirely from the query, forcing Odoo to evaluate and update the goals for all users involved in the challenge, regardless of their last detected presence in the notification bus.

This is an adaptation of a similar hard patch previously implemented in Odoo 16.0 (PR #614), where the optimization relied on the res_users_log table instead.

[1] #614


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Before this commit, Odoo attempted to optimize the `_update_all` method
in `gamification.challenge` by filtering users based on their recent
activity in the `bus_presence` table.

While this optimization works for internal users who frequently trigger
bus presence events by navigating the backend, it fails completely for
portal users (e.g., donors or customers). Portal users can remain
logged in and active on the website for long periods without ever
generating a new `last_presence` event, causing their gamification
goals to stall and stop updating.

This patch removes the `bus_presence` filters entirely from the query,
forcing Odoo to evaluate and update the goals for all users involved
in the challenge, regardless of their last detected presence in the
notification bus.

This is an adaptation of a similar hard patch previously implemented
in Odoo 16.0 (PR Vauxoo#614), where the optimization relied on the
`res_users_log` table instead.

[1] Vauxoo#614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant