summaryrefslogtreecommitdiff
path: root/odoo/addons/test_testing_utilities/tests/test_form_impl.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-03-22 12:43:50 +0000
committerXavier Morel <xmo@odoo.com>2019-04-03 08:44:21 +0000
commit922d77a29100453d831f61df9411715b383605df (patch)
treebd25858d555049285400c7d9c227417c63572239 /odoo/addons/test_testing_utilities/tests/test_form_impl.py
parent7e0b29cbcdaa324e342d6877dd220749b8211771 (diff)
[FIX] core: infinite recursion in SSF on self-recursive models
The extra setup probably affects any o2m whose edition view itself contains an o2m, but most likely to blow up entirely on models with some sort of tree structure (parent/child relationship): the SSF eagerly loads and setups the o2m's view, and the o2m's o2m's, ... ad infinitam. A better / cleaner fix would be to set up the subview on-demand (and possibly cache it), but the rest of the o2m stuff is unlikely to work correctly recursively so just don't recurse the o2m view setup at all for now. fixes #31458
Diffstat (limited to 'odoo/addons/test_testing_utilities/tests/test_form_impl.py')
-rw-r--r--odoo/addons/test_testing_utilities/tests/test_form_impl.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/addons/test_testing_utilities/tests/test_form_impl.py b/odoo/addons/test_testing_utilities/tests/test_form_impl.py
index c13dbd73a60..6b18fb229df 100644
--- a/odoo/addons/test_testing_utilities/tests/test_form_impl.py
+++ b/odoo/addons/test_testing_utilities/tests/test_form_impl.py
@@ -467,6 +467,9 @@ class TestO2M(TransactionCase):
self.assertEqual(commands(), [0, 2, 2], "should contain 1 '0' command and 2 deletions")
self.assertEqual(len(r.line_ids), 1)
+ def test_o2m_self_recursive(self):
+ Form(self.env['test_testing_utilities.recursive'], view='test_testing_utilities.o2m_recursive_relation_view')
+
class TestEdition(TransactionCase):
""" These use the context manager form as we don't need the record
post-save (we already have it) and it's easier to see what bits act on