MultiSelection crashes on save with a None value.
Traceback:
Traceback (most recent call last):
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/protocols/wrappers.py", line 189, in wrapper
return func(request, pool, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/protocols/dispatcher.py", line 204, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/modules/party/address.py", line 450, in write
super().write(*args, **kwargs)
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/model/modelsql.py", line 234, in wrapper
return func(cls, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/model/modelsql.py", line 1304, in write
update_values.append(field.sql_format(value))
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/hodeinavarro/Developer/test/.venv/lib/python3.11/site-packages/trytond/model/fields/multiselection.py", line 72, in sql_format
value = dumps(sorted(set(value)))
^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'NoneType' and 'str'
Repro:
Go to the latest demo, on Party Address Subdivision Types, try to save the empty first value and the second "Administration" value
Edited by Hodei Navarro