diff options
Diffstat (limited to 'odoo/addons/test_impex/tests/test_load.py')
| -rw-r--r-- | odoo/addons/test_impex/tests/test_load.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/odoo/addons/test_impex/tests/test_load.py b/odoo/addons/test_impex/tests/test_load.py index 3f9774545ae..e69d9d5ca71 100644 --- a/odoo/addons/test_impex/tests/test_load.py +++ b/odoo/addons/test_impex/tests/test_load.py @@ -887,6 +887,14 @@ class test_o2m(ImporterCase): values(b.value.sorted(), 'str'), 'this is the rhythm'.split()) + def test_subfields_fail_by_implicit_id(self): + result = self.import_(['value/parent_id'], [['noxidforthat']]) + self.assertEqual(result['messages'], [message( + u"No matching record found for name 'noxidforthat' in field 'Value/Parent'", + moreinfo=moreaction(res_model='export.one2many') + )]) + self.assertIs(result['ids'], False) + def test_link_inline(self): """ m2m-style specification for o2ms """ @@ -1073,6 +1081,18 @@ class test_realworld(SavepointCaseWithUserDemo): self.assertEqual([child.value for child in b[1].child.sorted()[1].child2], [12]) + def test_o2m_subfields_fail_by_implicit_id(self): + self.env['ir.model.data'].clear_caches() + Model = self.env['export.one2many.recursive'] + result = Model.load( + ['child/child1/parent_id'], + [['5'],], + ) + self.assertEqual(result['messages'], [message( + u"No matching record found for name '5' in field 'Child/Child1/Parent'", field='child', + moreinfo=moreaction(res_model='export.one2many.multiple'))]) + self.assertIs(result['ids'], False) + class test_date(ImporterCase): model_name = 'export.date' |
