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 ab05db3298
commit 2f956d6293
1 file changed
+10 -4
+10 -4
View File
@@ -1495,10 +1495,16 @@
}.bind(this));
},
get new_position() {
if (this.order) {
for (var j = 0; j < this.order.length; j++) {
var oexpr = this.order[j][0],
otype = this.order[j][1];
var order;
if (this.order !== null) {
order = this.order;
} else {
order = this.default_order;
}
if (order) {
for (var j = 0; j < order.length; j++) {
var oexpr = order[j][0],
otype = order[j][1];
if ((oexpr == 'id') && otype) {
if (otype.startsWith('DESC')) {
return 0;