summaryrefslogtreecommitdiff
path: root/odoo/addons/test_testing_utilities
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2018-10-26 11:39:53 +0000
committerXavier Morel <xmo@odoo.com>2018-10-26 11:39:53 +0000
commit8c9174ff80cf7d6be1e212935d5b7e26b737d5cd (patch)
tree81e4b2a2a9bcf29dd2f2e899e3c7670aa216e1e3 /odoo/addons/test_testing_utilities
parentbf65793b310e5eea7fd1f795bd2b148f3e6c2d83 (diff)
[FIX] base: handling of *_view_ref in SSF
The feature was not tested, and as it turns out completely broken: * the non-raw string means the "backrefs" were really interpreted as octal literals * the second backref was entirely wrong Also add all loaded views to the field descriptor in case we might have a use for it (and because inline sub-views are always stored on the descriptor). closes odoo/odoo#28194
Diffstat (limited to 'odoo/addons/test_testing_utilities')
-rw-r--r--odoo/addons/test_testing_utilities/tests/test_form_impl.py14
1 files changed, 14 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 2232e872dc6..a14d6b93974 100644
--- a/odoo/addons/test_testing_utilities/tests/test_form_impl.py
+++ b/odoo/addons/test_testing_utilities/tests/test_form_impl.py
@@ -284,6 +284,20 @@ class TestO2M(TransactionCase):
delegating to a separate form view
"""
f = Form(self.env['test_testing_utilities.parent'], view='test_testing_utilities.o2m_parent_ed')
+ custom_tree = self.env.ref('test_testing_utilities.editable_external').id
+
+ subs_field = f._view['fields']['subs']
+ tree_view = subs_field['views']['tree']
+ self.assertEqual(tree_view['type'], 'tree')
+ self.assertEqual(
+ tree_view['view_id'], custom_tree,
+ 'check that the tree view is the one referenced by tree_view_ref'
+ )
+ self.assertIs(subs_field['views']['edition'], tree_view, "check that the edition view is the tree view")
+ self.assertEqual(
+ subs_field['views']['edition']['view_id'],
+ custom_tree
+ )
with f.subs.new() as s:
s.value = 1