Unable to create complaing using relate
If an user tries to create a complaint from a sale the following exception is raised:
KeyError: 'sale'
File "trytond/protocols/dispatcher.py", line 186, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "trytond/model/modelsql.py", line 1247, in search
tables, expression = cls.search_domain(domain)
File "trytond/model/modelsql.py", line 1431, in search_domain
expression = convert(domain)
File "trytond/model/modelsql.py", line 1429, in convert
domain[1:] if domain[0] == 'AND' else domain)))
File "trytond/model/modelsql.py", line 1428, in <genexpr>
return And((convert(d) for d in (
File "trytond/model/modelsql.py", line 1426, in convert
return Or((convert(d) for d in domain[1:]))
File "trytond/model/modelsql.py", line 1426, in <genexpr>
return Or((convert(d) for d in domain[1:]))
File "trytond/model/modelsql.py", line 1418, in convert
field = cls._fields[fname]
Steps to reproduce on a fresh database:
1. Create a complain type related to a sale
2. Create a new sale and process it.
3. Open the "Complaint" relate
4. Create a new record on the screen.
5. Select "Sale" as origin and when trying to select a custom sale the exception above is raised.