m2o convert_domain_path: can not concatenate none and string when path is none
In a model has _history=True, when try to read the history, I get the traceback:
104152 140692552353536 [2023-04-27 09:14:16,843] ERROR trytond.protocols.dispatcher <class 'trytond.pool.project.work'>.read(*([47273], ['active', ....}), **{}) from raimon@127.0.0.1/nan64nan/
Traceback (most recent call last):
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/protocols/dispatcher.py", line 195, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 932, in read
getter_results = field.get(
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/function.py", line 26, in wrapper
return func(self, *args, **kwargs)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/function.py", line 136, in get
return call(names)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/function.py", line 130, in call
return method(records, name)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/modules/project/work.py", line 448, in get_total
works = cls.search([
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1504, in search
tables, expression = cls.__search_query(domain, count, query, order)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1423, in __search_query
tables, expression = cls.search_domain(domain)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1643, in search_domain
expression = convert(domain)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1639, in convert
return And((convert(d) for d in (
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1639, in <genexpr>
return And((convert(d) for d in (
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/modelsql.py", line 1630, in convert
expression = field.convert_domain(domain, tables, cls)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/field.py", line 200, in wrapper
return func(*args, **kwargs)
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/many2one.py", line 235, in convert_domain
return self.convert_domain_path(
File "/home/raimon/projectes/nandev2/nan64nan/trytond/trytond/model/fields/many2one.py", line 136, in convert_domain_path
where.append(path_column.like(path + '%'))
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
In see that in database som history rows, path is none. Example:
id | path | create_date
-------+--------------+----------------------------
47273 | | 2022-10-11 15:19:41.924071
47273 | 30856/47273/ | 2022-10-11 15:19:41.924071
...