TypeError when trying to add an invoice line on a supplier invoice on Tryton 7.0
On Tryton 7.0 (GTK) got this error when trying to add an invoice line on a supplier invoice:
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 513, in _sig_add
win.screen.search_filter(quote(text))
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/gui/window/view_form/screen/screen.py", line 288, in search_filter
if (canonicalized := canonicalize(domain)) != self._current_domain:
^^^^^^^^^^^^^^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 397, in canonicalize
return simplify_AND(sort(simplify(domain)))
^^^^^^^^^^^^^^^^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 312, in sort
return sorted((sort(e) for e in domain), key=_sort_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 312, in <genexpr>
return sorted((sort(e) for e in domain), key=_sort_key)
^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 312, in sort
return sorted((sort(e) for e in domain), key=_sort_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 312, in <genexpr>
return sorted((sort(e) for e in domain), key=_sort_key)
^^^^^^^
File "/home/mrichez/Workspace/tryton/issues/tryton_70_dev/tryton/tryton/common/domain_inversion.py", line 312, in sort
return sorted((sort(e) for e in domain), key=_sort_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'float' and 'str'
it happens with this domain: ['OR', [['company', '=', 1], ['currency', '=', 143], ['OR', ['account', '=', None], ['account', '!=', 221]], ['OR', ['invoice_type', '=', 'in'], ['invoice_type', '=', None]], ['OR', ['party', '=', 1263], ['party', '=', None]], ['invoice', '=', None]], ('id', 'in', [])]
when doing: sort(simplify(domain))
[tryton/tryton/common/domain_inversion.py:391]
Edited by Sergi Almacellas Abellana