details: https://code.tryton.org/tryton/commit/83905b96c05c
branch: 7.0
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
(grafted from 2d7c2466ae0eda5dc670cc8fd2ee5b386fb704ab)
diffstat:
tryton/tryton/gui/window/view_form/view/screen_container.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diffs (20 lines):
diff -r 208c0e55d2c1 -r 83905b96c05c
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:00:50 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
@@ -617,7 +616,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'):