details:   https://code.tryton.org/tryton/commit/2d7c2466ae0e
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Jun 08 16:19:50 2026 +0200
description:
        Sort selection strings without key function

        The selection is a list of string so we can sort as-is.

        Closes #14883
diffstat:

 tryton/tryton/gui/window/view_form/view/screen_container.py |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 3f16016f4aa9 -r 2d7c2466ae0e 
tryton/tryton/gui/window/view_form/view/screen_container.py
--- a/tryton/tryton/gui/window/view_form/view/screen_container.py       Tue Jun 
02 12:24:25 2026 +0200
+++ b/tryton/tryton/gui/window/view_form/view/screen_container.py       Mon Jun 
08 16:19:50 2026 +0200
@@ -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 @@
                 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'):

Reply via email to