[FIX] gamification: Force goal updates for portal users#651
Open
JVegaB wants to merge 1 commit intoVauxoo:18.0from
Open
[FIX] gamification: Force goal updates for portal users#651JVegaB wants to merge 1 commit intoVauxoo:18.0from
JVegaB wants to merge 1 commit intoVauxoo:18.0from
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this commit, Odoo attempted to optimize the
_update_allmethod ingamification.challengeby filtering users based on their recent activity in thebus_presencetable.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_presenceevent, causing their gamification goals to stall and stop updating.This patch removes the
bus_presencefilters 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_logtable instead.[1] #614
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr