Fallback to empty string when column path is NULL

Closes #12235
This commit is contained in:
Cédric Krier
2023-06-06 12:55:12 +02:00
parent 01727ac772
commit de95e79417
+1
View File
@@ -133,6 +133,7 @@ class Many2One(Field):
red_sql = reduce_ids(table.id, (i for i in ids if i is not None))
Target = self.get_target()
path_column = getattr(Target, self.path).sql_column(table)
path_column = Coalesce(path_column, '')
cursor.execute(*table.select(path_column, where=red_sql))
if operator.endswith('child_of'):
where = Or()