Issue 4710

Search on dict fields. FIX when is a str and new options to search in toolbar box
Nosy list
ced, resteve
Assigned to

Created on 2015-04-22.09:53:31 by resteve, last changed 76 months ago by reviewbot.


Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2015-04-22.10:13:24
Not a bug but a feature.
Author: [hidden] (resteve)
Date: 2015-04-22.09:53:29
When search in dict fields in toolbar search box client, example search toolbar box:

Attributes: "text1"

In this case, attribute is a string value and get this traceback:

Traceback (most recent call last):
  File "/trytond/protocols/", line 150, in _marshaled_dispatch
    response['result'] = dispatch_method(method, params)
  File "/trytond/protocols/", line 179, in _dispatch
    res = dispatch(*args)
  File "/trytond/protocols/", line 161, in dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/", line 975, in search
    tables, expression = cls.search_domain(domain)
  File "/", line 272, in search_domain
  File "/trytond/model/", line 1156, in search_domain
    expression = convert(domain)
  File "/trytond/model/", line 1154, in convert
    domain[1:] if domain[0] == 'AND' else domain)))
  File "/trytond/model/", line 1153, in <genexpr>
    return And((convert(d) for d in (
  File "/trytond/model/", line 1144, in convert
    expression = field.convert_domain(domain, tables, cls)
  File "/trytond/model/fields/", line 259, in convert_domain
    expression = Operator(column, self._domain_value(operator, value))
  File "/trytond/model/fields/", line 237, in _domain_value
    return self.sql_format(value)
  File "/trytond/model/fields/", line 40, in sql_format
    assert isinstance(value, dict)

An idea to search dict fields in toolbar is in case is string, create a dict. User could search in toolbar when write "key:value" separated by comm. Example:

Attributes: "text1:222"


Attributes: "text1:222,text2:abc DF"
Date User Action Args
2015-04-22 17:30:26reviewbotsetreviews: 12121002
keyword: + review
2015-04-22 10:13:24cedsetpriority: bug -> feature
nosy: + ced
messages: + msg21096
2015-04-22 09:53:31restevecreate

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