From ac0e3d842ee449225a6d0ede91d2f0cdc9cb0002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 8 Jun 2026 16:19:50 +0200 Subject: [PATCH] Sort selection strings without key function The selection is a list of string so we can sort as-is. Closes #14883 (grafted from 2d7c2466ae0eda5dc670cc8fd2ee5b386fb704ab) --HG-- branch : 8.0 --- tryton/tryton/gui/window/view_form/view/screen_container.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tryton/tryton/gui/window/view_form/view/screen_container.py b/tryton/tryton/gui/window/view_form/view/screen_container.py index 0ca477a43b..9262a1c73f 100644 --- a/tryton/tryton/gui/window/view_form/view/screen_container.py +++ b/tryton/tryton/gui/window/view_form/view/screen_container.py @@ -2,7 +2,6 @@ # this repository contains the full copyright notices and license terms. import datetime import gettext -import operator from gi.repository import Gdk, GLib, GObject, Gtk @@ -629,7 +628,7 @@ class ScreenContainer(object): elif field['type'] in ['selection', 'multiselection']: selections = [x[1] for x in field['selection']] if field.get('sort', True): - selections.sort(key=operator.itemgetter(1)) + selections.sort() entry = Selection(tuple(selections)) entry.set_vexpand(True) elif field['type'] in ('date', 'datetime', 'time'):