Repository navigation
Conversation
|
@NachoAlesLopez this continues your #613, with your two commits kept as they were. The CLA check can't find a signature for [email protected]. Could you sign it, or check that it's on Dynapps' company CLA? |
lmignon
left a comment
There was a problem hiding this comment.
Thank you for the migration... Nevertheless I've a little concern regarding a change into the tests for which I would like some highlight.
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.setUpRegistry() | ||
| cls.base_url = cls.env["ir.config_parameter"].get_param("web.base.url") | ||
| cls.registry.enter_test_mode(cls.env.cr) | ||
| # pylint: disable=W8106 | ||
| def setUp(self): | ||
| super().setUp() | ||
| self.setUpRegistry() | ||
| self.base_url = self.env["ir.config_parameter"].get_param("web.base.url") | ||
| self.registry_enter_test_mode(register_cleanup=False) |
There was a problem hiding this comment.
It looks suspicious to me to have the registry to enter in test mode into the setUp method but leave it into the tearDownClass.... Why do you need to change from setUpClass to setUp?
There was a problem hiding this comment.
Addressed in a new commit b68a97a. The move to setUp came from the original port in #613 (aca030c). Odoo 19 removed Registry.enter_test_mode(), and its replacement registry_enter_test_mode() is an instance method. Entering per test and leaving per class worked only because CommonCase has one test. With a second test, setUp fails with "Can only patch registry once". The new commit enters test mode in setUpClass with registry_enter_test_mode_cls(), which leaves it in a class cleanup, as HttpCase does. It also adds that second test. CI passes with Odoo and OCB, and the second test fails on the previous head.
|
@lmignon I made the change you asked for in b68a97a. Could you look again when you have time? The CLA check is red only for the two commits I kept from #613. Their author has not replied yet. If he does not sign, would you accept these two commits under my name, with a note that credits him? Prepared with the help of AI |
lmignon
left a comment
There was a problem hiding this comment.
Thank you for the fixes, @calpeyser. LGTM!
Regarding the CLA and contribution ownership, the original author must agree to the reassignment of authorship for their commits. I have no authority to make that decision.
|
I'm ok with your proposal
Le lun. 23 nov. 2026, 16:09, Cal Peyser ***@***.***> a écrit :
… *calpeyser* left a comment (OCA/rest-framework#686)
<#686 (comment)>
@lmignon <https://github.com/lmignon> Nacho has not replied on GitHub or
by email since 2026-11-05. Would you accept it if I redo the migration
myself from 18.0, without his two commits, so the CLA check passes? The
description would still credit #613
<#613>.
—
Reply to this email directly, view it on GitHub
<#686?email_source=notifications&email_token=AAEE2WTVIH3CD4W7W7SEASD52RHJZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJQGUYTAMJTGU42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-7105101359>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEE2WSW5YD2XNUJLWGLZR352RHJZAVCNFSNUABFKJSXA33TNF2G64TZHMYTIMZQGE3TQNZWHNEXG43VMU5TMMRSHEYTMNZQGQYKC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AAEE2WW25N57S6JXJG4NYZ352RHJZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJQGUYTAMJTGU42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AAEE2WQIY2YAF7QJAO7MHWD52RHJZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMJQGUYTAMJTGU42M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Disable logging for deprecation. You might have big projects, with tons of services with no specific decorator, that are well tested and very stable and you don't want to touch them. Especially if you plan already to move to v16. Since this logging can bloat your CI and your log collecting tools, here is a way to prevent that and get only a msg at boot. Once enabled, you'll see this msg in the logs only at start up: 'odoo.addons.base_rest.components.service: REST_API_METHOD_FIX_DECORATOR_DEPRECATE_LOG_DISABLE enabled: implicit service methods are deprecated. Disable this env key and enable debug level to have more details.'
Earlier port attempt: OCA#613 by Nacho Ales Lopez
Odoo 19 removed config.get_misc(), so building the JSON body of any error raised AttributeError and the client got an HTML 500. Read the [base_rest] section of the config file directly.
BaseRestCase enters registry test mode once in setUpClass, and a class cleanup leaves it, as HttpCase does. A second test in CommonCase checks that the registry is still patched after the first test.
The script was also in web.assets_frontend, so every frontend page without a Swagger element, such as /web/login, raised a TypeError on load. The /api-docs template already loads the script itself.
b68a97a to
bb2fc6e
Compare
On 19.0 a request that fails validation returns an HTML 500 instead of JSON, because Odoo 19 removed
config.get_misc()and building the error body fails.base_restnow reads its[base_rest]config section itself, sodev_mode = Truestill works, and the same request returns a JSON 400. The new test fails before the fix and passes after it, and the suite passes in the OCA CI images.Continues #613 by NachoAlesLopez.
Prepared with the help of AI