Fall-back to default order to define new position

When there is no order on the screen, we must use the default order because it
contains the order of the relation field.

issue10298
review340621002
This commit is contained in:
Cédric Krier committed 2021-04-21 23:51:15 +02:00
1 parent 917e00409a
commit 8244e8a29d
1 file changed
+6 -2
+6 -2
View File
@@ -635,8 +635,12 @@ class Screen(SignalEvent):
@property
def new_position(self):
if self.order:
for oexpr, otype in self.order:
if self.order is not None:
order = self.order
else:
order = self.default_order
if order:
for oexpr, otype in order:
if oexpr == 'id' and otype:
if otype.startswith('DESC'):
return 0