Tryton - Issues

 

Issue6514

Title Tests broken by sqlite 3.16.0
Priority bug Status testing
Superseder Nosy List ced, reviewbot
Type crash Components trytond
Assigned To ced Keywords review
Reviews 34131002
View: 34131002

Created on 2017-05-18.16:08:57 by ced, last changed by reviewbot.

Messages
review34131002 updated at https://codereview.tryton.org/34131002/#ps1
msg33703 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-05-18.16:08:56
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).
History
Date User Action Args
2017-05-18 16:40:31reviewbotsetnosy: + reviewbot
messages: + msg33704
2017-05-18 16:18:51cedsetstatus: in-progress -> testing
reviews: 34131002
keyword: + review
2017-05-18 16:08:57cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)