changeset 7e98b9b3eeb4 in tryton:5.6
details: https://hg.tryton.org/tryton?cmd=changeset;node=7e98b9b3eeb4
description:
Ensure inserted record has a valid position
issue9731
review298881002
(grafted from c1f77d93195bf6a74576feffe14e94812512d625)
diffstat:
tryton/gui/window/view_form/model/group.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diffs (11 lines):
diff -r d85385cba0e2 -r 7e98b9b3eeb4 tryton/gui/window/view_form/model/group.py
--- a/tryton/gui/window/view_form/model/group.py Thu Oct 22 12:11:09
2020 +0200
+++ b/tryton/gui/window/view_form/model/group.py Sat Oct 24 13:12:01
2020 +0200
@@ -91,6 +91,7 @@
def insert(self, pos, record):
assert record.group is self
+ pos = min(pos, len(self))
if pos >= 1:
self.__getitem__(pos - 1).next[id(self)] = record
if pos < self.__len__():