fix(module): drop clear_caches() outright (adopts #237) - #279
Merged
Conversation
#266 fixed #236 by guarding clear_caches() in try/except; this adopts bosd's cleaner approach from #237 and drops the call entirely. It was removed from the ORM's RPC surface in Odoo 19 and is unnecessary on every version — update_list() commits server-side and the following search_count() is a fresh read — so removing it is version-safe AND avoids a wasted, always-failing round-trip on Odoo 19. Tests: update-list no longer calls clear_caches (assert_not_called); dropped the now-moot 'survives a raising clear_caches' test.
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.
#236was already fixed in #266 (merged) by guardingclear_caches()in a try/except, plus fixing the secondaryread()-shapeTypeErrorthat #237 left open. This PR adopts bosd's cleaner approach from #237: drop theclear_caches()call entirely.Rationale (bosd's, and sound): the method was removed from the ORM's RPC surface in Odoo 19 and is unnecessary on every version —
update_list()commits server-side and the followingsearch_count([])is a fresh read that already reflects the new state. Removing it is version-safe and avoids a wasted, always-failing round-trip on every Odoo 19update-list(which the guard still incurred).update-listno longer callsclear_caches(assert_not_called); dropped the now-moot "survives a raising clear_caches" test.Supersedes and closes #237. (The
read()TypeErrorhalf of #236 stays fixed from #266.)