changeset c6d2aaa0bcea in sao:5.4 details: https://hg.tryton.org/sao?cmd=changeset;node=c6d2aaa0bcea description: Ensure inserted record has a valid position
issue9731 review298881002 (grafted from b028a776dcda25244877378e41fcb6e43b322b27) diffstat: src/model.js | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (11 lines): diff -r 249d1bccd47f -r c6d2aaa0bcea src/model.js --- a/src/model.js Wed Oct 21 23:15:18 2020 +0200 +++ b/src/model.js Sat Oct 24 13:12:01 2020 +0200 @@ -142,6 +142,7 @@ if ((position === undefined) || (position == -1)) { position = this.length; } + position = Math.min(position, this.length); if (changed === undefined) { changed = true; }