Repository navigation
[20.0][MIG] rpc_helper: Migration to 20.0 - #3874
Open
yabdelhamed wants to merge 19 commits into
Open
yabdelhamed wants to merge 19 commits into
yabdelhamed wants to merge 19 commits into
Conversation
Currently translated at 100.0% (16 of 16 strings) Translation: server-tools-14.0/server-tools-14.0-rpc_helper Translate-URL: https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-rpc_helper/es_AR/
Currently translated at 100.0% (8 of 8 strings) Translation: server-tools-16.0/server-tools-16.0-rpc_helper Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-rpc_helper/es/ Added translation using Weblate (Spanish)
Currently translated at 100.0% (8 of 8 strings) Translation: server-tools-16.0/server-tools-16.0-rpc_helper Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-rpc_helper/it/
Currently translated at 100.0% (17 of 17 strings) Translation: server-tools-16.0/server-tools-16.0-rpc_helper Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-rpc_helper/es_AR/
Currently translated at 100.0% (17 of 17 strings) Translation: server-tools-16.0/server-tools-16.0-rpc_helper Translate-URL: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-rpc_helper/it/
Fixes ``` INFO odoo odoo.addons.rpc_helper.tests.test_xmlrpc: Starting TestXMLRPC.test_xmlrpc_can_search_create_blocked__ir_model ... INFO odoo werkzeug: 127.0.0.1 - - [04/Feb/2025 13:39:13] "POST /xmlrpc/2/object HTTP/1.1" 200 - 22 0.006 0.437 WARNING odoo odoo.http: RPC call on res.partner is not allowed ``` New logging is due to odoo/odoo@a65b1d8
execute_cr no longer resets the cursor and the registry has no clear_cache anymore, ormcache invalidation goes through the transaction. The decorator tests now extend BaseCase so the test runner picks them up.
3 of 30 tasks
|
The following commit authors need to sign the Contributor License Agreement: |
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.
Migration of
rpc_helperto 20.0, done with theformat-patchprocedure from the migration guide, so the history and authors are kept.Changes for 20.0:
20.0.1.0.0.odoo.service.model.execute_crno longer callscr.reset(), and the cursor has noresetanymore, so every RPC call failed in the patched function. The patch now follows the 20.0 function.Registry.clear_cache()is gone. Writingrpc_config_editnow callsenv.transaction.invalidate_ormcache(), asir.modelitself does in 20.0, and_get_rpc_configusesapi.ormcache.test_decorator.pyused a plainunittest.TestCase, which the Odoo test runner doesn't collect, so its 3 tests never ran. It now extendsBaseCase.withblocks intest_xmlrpc.pyare merged, as ruff on 20.0 requires (SIM117).Tests, run locally with the CI images
ghcr.io/oca/oca-ci/py3.12-odoo20.0andpy3.12-ocb20.0againstpgvector/pgvector:pg16, usingoca_install_addons,oca_init_test_databaseandoca_run_tests:cr.reset,Registry.clear_cache)._rpc_allowedcheck skipped inpatch.py, 4 of the 8 fail, so the tests still cover the blocking.pre-commit run -apasses.Note, not changed here: the JSON-2 endpoint (
/json/2/<model>/<method>, added in 19.0) calls the model method directly and doesn't go throughexecute_cr, so methods disabled with this module can still be called that way on 19.0 and 20.0. The caller still needs an API key and the user's access rights. I'm happy to send a follow-up PR that covers it if you want this module to handle JSON-2 too.Part of #3772.