diff options
| author | Raphael Collet <rco@odoo.com> | 2020-04-02 13:11:51 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2020-04-02 23:54:32 +0000 |
| commit | 46b7fb598498dfe8673268e82944488b741f5caa (patch) | |
| tree | 94d9289051fe5bf8dd1f5d3a4639ec749b6b7d0f /odoo/addons/test_new_api | |
| parent | 0f7d670434cd51e8f19609acd5f8bfae020575ea (diff) | |
[FIX] core: do not register classes when `_module` is falsy
The goal is to avoid a class from being added in the dictionary
`MetaModel.module_to_models`.
We use this feature in tests to prevent classes extending models from
triggering bugs when reloading the registry (for whatever reason).
X-original-commit: 12db61b787b2035bf0c1f2a68a24449d484744c8
Diffstat (limited to 'odoo/addons/test_new_api')
| -rw-r--r-- | odoo/addons/test_new_api/tests/test_new_fields.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py index ee89c51ab8d..97d1cb2dacc 100644 --- a/odoo/addons/test_new_api/tests/test_new_fields.py +++ b/odoo/addons/test_new_api/tests/test_new_fields.py @@ -2615,6 +2615,7 @@ class TestSelectionOndeleteAdvanced(common.TransactionCase): def test_ondelete_unexisting_policy(self): class Foo(models.Model): + _module = None _inherit = self.MODEL_REQUIRED my_selection = fields.Selection(selection_add=[ @@ -2628,6 +2629,7 @@ class TestSelectionOndeleteAdvanced(common.TransactionCase): def test_ondelete_default_no_default(self): class Foo(models.Model): + _module = None _inherit = self.MODEL_BASE my_selection = fields.Selection(selection_add=[ @@ -2641,6 +2643,7 @@ class TestSelectionOndeleteAdvanced(common.TransactionCase): def test_ondelete_required_null_explicit(self): class Foo(models.Model): + _module = None _inherit = self.MODEL_REQUIRED my_selection = fields.Selection(selection_add=[ @@ -2654,6 +2657,7 @@ class TestSelectionOndeleteAdvanced(common.TransactionCase): def test_ondelete_required_null_implicit(self): class Foo(models.Model): + _module = None _inherit = self.MODEL_REQUIRED my_selection = fields.Selection(selection_add=[ |
