Not like operation is not working on tree model
I added the following test in the test_tree.py
:
@with_transaction()
def test_search_rec_name_not_like(self):
"Test search_rec_name not like"
pool = Pool()
Tree = pool.get('test.tree')
parent = Tree(name="parent")
parent.save()
record = Tree(name="record", parent=parent)
record.save()
child = Tree(name="child", parent=record)
child.save()
records = Tree.search([('rec_name', 'not like', '%record%')])
self.assertEqual(records, [parent, child])
Which fails with:
======================================================================
FAIL: test_search_rec_name_not_like (test_tree.TreeMixinTestCase.test_search_rec_name_not_like)
Test search_rec_name not like
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/pokoli/projectes/tryton/trytond/trytond/tests/test_tryton.py", line 267, in wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/pokoli/projectes/tryton/trytond/trytond/tests/test_tree.py", line 380, in test_search_rec_name_not_like
self.assertEqual(records, [parent, child])
AssertionError: Lists differ: [Pool[16 chars]e')(1), Pool().get('test.tree')(2), Pool().get('test.tree')(3)] != [Pool[16 chars]e')(1), Pool().get('test.tree')(3)]
First differing element 1:
Pool().get('test.tree')(2)
Pool().get('test.tree')(3)
First list contains 1 additional elements.
First extra element 2:
Pool().get('test.tree')(3)
+ [Pool().get('test.tree')(1), Pool().get('test.tree')(3)]
- [Pool().get('test.tree')(1),
- Pool().get('test.tree')(2),
- Pool().get('test.tree')(3)]
Run the test on latest trunk but I can also reproduce the same problem with trytond-console
in 7.0 series. I did not test any other series.b