Repository navigation
Conversation
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.
Ignore the Chrome zombie and the libsass 0.20 frontend warnings, as OCA/web and OCA/server-tools do on 19.0.
|
The following commit authors need to sign the Contributor License Agreement: |
|
@NachoAlesLopez this continues your #613, with your two commits kept as they were. The CLA check can't find a signature for nacho.aleslopez@dynapps.eu. 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.
Odoo 19 removed Registry.enter_test_mode(). Use registry_enter_test_mode_cls(), which also leaves test mode in a class cleanup, as HttpCase does. The per-test enter with a per-class leave failed on a class with more than one test.
|
@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.
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