From f258f4a7ba0bb6a3d752408a02e2f2defe9d46a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Tue, 3 Jan 2023 17:20:41 +0100 Subject: [PATCH] Return an empty list when the treeview has no selection Closes #11960 --HG-- branch : 6.0 --- tryton/tryton/gui/window/view_form/view/list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/tryton/gui/window/view_form/view/list.py b/tryton/tryton/gui/window/view_form/view/list.py index 3aeb3b9827..e119708e0f 100644 --- a/tryton/tryton/gui/window/view_form/view/list.py +++ b/tryton/tryton/gui/window/view_form/view/list.py @@ -1165,7 +1165,8 @@ class ViewTree(View): records.append(model.get_value(iter_, 0)) records = [] sel = self.treeview.get_selection() - sel.selected_foreach(_func_sel_get, records) + if sel is not None: + sel.selected_foreach(_func_sel_get, records) return records def get_selected_paths(self):