lims_interface: Position new record based on order

https://bugs.tryton.org/issue8880
This commit is contained in:
Sebastián Marró 2020-10-29 18:31:57 -03:00
parent 9e6166c638
commit eb343dfa00
1 changed files with 8 additions and 5 deletions

View File

@ -459,11 +459,14 @@ class Data(ModelSQL, ModelView):
for oexpr, otype in order:
fname, _, extra_expr = oexpr.partition('.')
field = cls._fields[fname]
otype = otype.upper()
try:
otype, null_ordering = otype.split(' ', 1)
except ValueError:
null_ordering = None
if not otype:
otype, null_ordering = 'ASC', None
else:
otype = otype.upper()
try:
otype, null_ordering = otype.split(' ', 1)
except ValueError:
null_ordering = None
Order = order_types[otype]
NullOrdering = null_ordering_types[null_ordering]
forder = field.convert_order(oexpr, tables, cls)