summaryrefslogtreecommitdiff
path: root/odoo/addons/test_testing_utilities/tests/test_form_impl.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2020-06-09 12:08:09 +0000
committerRaphael Collet <rco@odoo.com>2020-08-20 13:39:04 +0000
commit488e334fc8fd6601e304635fa577c98b9bfd18e6 (patch)
tree30c70f257a17ccf36a71ffa66dd917ddf9ef978e /odoo/addons/test_testing_utilities/tests/test_form_impl.py
parent540682b9bef4d3ee1c02056aa5199b5b463a9363 (diff)
[REF] core: combine default_get() with first onchange()
When creating a new record, the client calls `default_get()`, completes the returned values with `False`, and calls `onchange()` to apply the onchange to the defaults. Optimize the double round-trip by integrating `default_get()` inside `onchange()` for the first call. The method is called with an empty list of fields, and usually no field values, except for records in a one2many field. In this case, `onchange()` does both steps above. Task 2261084
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.py4
1 files changed, 2 insertions, 2 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 af49d27cbe5..ab846bda87e 100644
--- a/odoo/addons/test_testing_utilities/tests/test_form_impl.py
+++ b/odoo/addons/test_testing_utilities/tests/test_form_impl.py
@@ -374,13 +374,13 @@ class TestO2M(TransactionCase):
with f.subs.edit(index=0) as s:
self.assertEqual(s.v, 5)
- self.assertEqual(s.value, False)
+ self.assertEqual(s.value, 2)
r = f.save()
self.assertEqual(
[get(s) for s in r.subs],
- [("5", 0, 5)]
+ [("5", 2, 5)]
)
def test_o2m_inner_default(self):