From 96d9f262023033ea3a4618ea81dbf12e8c185605 Mon Sep 17 00:00:00 2001 From: SilvioC2C Date: Fri, 12 Jun 2026 16:57:20 +0200 Subject: [PATCH 1/3] [IMP] component: improve test setup Class ``TransactionComponentCase.setUp()`` was not calling ``super()`` because of an inheritance issue: ``odoo.tests.common.TransactionCase.setUp()`` was not calling ``super()`` either. Since the issue has been solved, the test setup can be improved, allowing subclasses that inherit from ``TransactionComponentCase`` to correctly resolve the chain of ``super().setUp()`` calls. --- component/tests/common.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/component/tests/common.py b/component/tests/common.py index 49133c4ee..05e8c5901 100644 --- a/component/tests/common.py +++ b/component/tests/common.py @@ -74,20 +74,6 @@ def setUpClass(cls): super().setUpClass() cls.setUpComponent() - # pylint: disable=W8106 - def setUp(self): - # resolve an inheritance issue (common.TransactionCase does not call - # super) - common.TransactionCase.setUp(self) - ComponentMixin.setUp(self) - # There's no env on setUpClass of TransactionCase, must do it here. - self.env = self.env( - context=dict( - self.env.context, - components_registry=self._components_registry, - ) - ) - class ComponentRegistryCase: """This test case can be used as a base for writings tests on components From 048c4713b020ef4ea60e6eba9b9e93a0ed5df1d5 Mon Sep 17 00:00:00 2001 From: SilvioC2C Date: Wed, 17 Jun 2026 13:05:57 +0200 Subject: [PATCH 2/3] [FIX] component: fix test setup Commit 96d9f26 improved test setup, but introduced a bug: the components registry was never flagged as 'ready' anymore. This commit fixes such bug. --- component/tests/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/component/tests/common.py b/component/tests/common.py index 05e8c5901..ae2f5e498 100644 --- a/component/tests/common.py +++ b/component/tests/common.py @@ -46,10 +46,6 @@ def setUpComponent(cls): ) ) - # pylint: disable=W8106 - def setUp(self): - self.setUpComponentRegistryReady() - def setUpComponentRegistryReady(self): # should be ready only during tests, never during installation # of addons @@ -74,6 +70,10 @@ def setUpClass(cls): super().setUpClass() cls.setUpComponent() + def setUp(self): + super().setUp() + self.setUpComponentRegistryReady() + class ComponentRegistryCase: """This test case can be used as a base for writings tests on components From f29c2856b4298ea05e2f6e7c2b764a3aca587ab8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 17 Jun 2026 13:32:11 +0000 Subject: [PATCH 3/3] [BOT] post-merge updates --- README.md | 2 +- component/README.rst | 2 +- component/__manifest__.py | 2 +- component/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0e11ab393..f32271790 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[component](component/) | 19.0.1.0.0 | guewen | Add capabilities to register and use decoupled components, as an alternative to model classes +[component](component/) | 19.0.1.0.1 | guewen | Add capabilities to register and use decoupled components, as an alternative to model classes [component_event](component_event/) | 19.0.1.0.0 | | Components Events [connector](connector/) | 19.0.1.0.0 | | Connector diff --git a/component/README.rst b/component/README.rst index 87bac4777..bbde97eed 100644 --- a/component/README.rst +++ b/component/README.rst @@ -11,7 +11,7 @@ Components !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b63945d684e8a6c044ec20bb71c7416401aa40cd08add380808c45cbaef56be4 + !! source digest: sha256:f4c2650eb68d9b099f19c5378dbcda1423050eba34d923714286b891d60ae5ea !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/component/__manifest__.py b/component/__manifest__.py index 128d583a1..13216f78f 100644 --- a/component/__manifest__.py +++ b/component/__manifest__.py @@ -5,7 +5,7 @@ "name": "Components", "summary": "Add capabilities to register and use decoupled components," " as an alternative to model classes", - "version": "19.0.1.0.0", + "version": "19.0.1.0.1", "author": "Camptocamp,Odoo Community Association (OCA)", "website": "https://github.com/OCA/connector", "license": "LGPL-3", diff --git a/component/static/description/index.html b/component/static/description/index.html index 26d91325a..dcecc3e2a 100644 --- a/component/static/description/index.html +++ b/component/static/description/index.html @@ -372,7 +372,7 @@

Components

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:b63945d684e8a6c044ec20bb71c7416401aa40cd08add380808c45cbaef56be4 +!! source digest: sha256:f4c2650eb68d9b099f19c5378dbcda1423050eba34d923714286b891d60ae5ea !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: LGPL-3 OCA/connector Translate me on Weblate Try me on Runboat

This module implements a component system and is a base block for the