Fix order for selection fields that use a function instead of list.
This commit is contained in:
1 parent
73a256f5b4
commit
77b667f647
1 file changed
+4
@@ -2984,6 +2984,10 @@ class ORM(object):
|
||||
and self._columns[field_name]._type == 'selection':
|
||||
selections = self.fields_get(cursor, user, [field_name],
|
||||
context=context)[field_name]['selection']
|
||||
if not isinstance(selections, (tuple, list)):
|
||||
selections = getattr(self,
|
||||
self._columns[field_name].selection)(cursor,
|
||||
user, context=context)
|
||||
order = 'CASE ' + table_name + '.' + field_name
|
||||
for selection in selections:
|
||||
order += ' WHEN \'%s\' THEN \'%s\'' % selection
|
||||
|
||||
Reference in new issue
Block a user