changeset c1f77d93195b in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=c1f77d93195b
description:
        Ensure inserted record has a valid position

        issue9731
        review298881002
diffstat:

 tryton/gui/window/view_form/model/group.py |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff -r b99e3e417696 -r c1f77d93195b 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__():

Reply via email to