Tests broken by sqlite 3.16.0
The test_menu_action fails when running with sqlite >=3.16.0:
ERROR: test_menu_action (trytond.modules.stock.tests.test_stock.StockTestCase)
Test that menu actions are accessible to menu's group
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/tests/test_tryton.py", line 168, in wrapper
result = func(*args, **kwargs)
File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/tests/test_tryton.py", line 333, in test_menu_action
if not menu.action_keywords:
File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/modelstorage.py", line 1369, in __getattr__
read_data = self.read(list(ids), ffields.keys())
File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/modelsql.py", line 759, in read
getter_result = field.get(ids, cls, fname, values=result)
File "/home/ced/b2ck/trunk/trytond-cost-product/trytond/model/fields/one2many.py", line 116, in get
origin_id = getattr(target, self.field).id
AttributeError: 'NoneType' object has no attribute 'id'
The issue is a bug in sqlite: https://www.sqlite.org/src/tktview?name=61fe97454c
But there are any fixed release yet.
Indeed the issue is particularly exposed by the Menu.search method which construct a parent search using a list that has great chances to have duplicates ids.
I think we should fix the trytond code because it will not create false positive test failure and also because it will improve any way the performance by removing duplicated ids (and also the length of the list could become too long for the SQL query).