summaryrefslogtreecommitdiff
path: root/odoo/addons/test_testing_utilities/tests/test_form_impl.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2019-09-24 13:22:25 +0000
committerfw-bot <otis@odoo.com>2019-09-25 16:37:19 +0000
commit77099c54b602eb1a71c2a176eeebcceefaf7aec6 (patch)
tree285eed8e714dab9e5dae740f74b24eba656b7742 /odoo/addons/test_testing_utilities/tests/test_form_impl.py
parent98b7129e20979a4dbbeb72ea1109112744f813d5 (diff)
[FIX] core: o2m modifiers in the SSF
Because the sub-record values would not necessarily get fetched ever (whether default or stored), the computation of modifiers might blow up if it relied on one of the un-fetched un-specified fields. One such situation is trying to create a partner with child partners if base_address_city is installed: the module adds a readonly attr predicated upon the parent_id, without explicitly providing such the field would be missing from the O2M record's values. Closes #37176 closes odoo/odoo#37452 X-original-commit: 184d1b69eac2b78c72228c81c5c6cf8cc4a56eb4 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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.py11
1 files changed, 11 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 c0e5093fd3b..a7cd141696c 100644
--- a/odoo/addons/test_testing_utilities/tests/test_form_impl.py
+++ b/odoo/addons/test_testing_utilities/tests/test_form_impl.py
@@ -497,6 +497,17 @@ class TestO2M(TransactionCase):
def test_o2m_self_recursive(self):
Form(self.env['test_testing_utilities.recursive'], view='test_testing_utilities.o2m_recursive_relation_view')
+ def test_o2m_attrs(self):
+ Model = self.env['test_testing_utilities.parent'].with_context(
+ default_subs=[{
+ 'value': 5,
+ }, {
+ 'value': 7,
+ }]
+ )
+ f = Form(Model, view='test_testing_utilities.o2m_modifier')
+ f.save()
+
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