diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 2a432cb8be..2533e584a5 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -328,6 +328,8 @@ class ViewList(ParserView): data = [] treeselection = treeview.get_selection() treeselection.selected_foreach(_func_sel_get, data) + if not data: + return data = str(data[0]) selection.set(selection.target, 8, data) @@ -339,6 +341,8 @@ class ViewList(ParserView): if model[treeview.sequence].get_state_attrs( model).get('readonly', False): return + if not selection.data: + return model = treeview.get_model() data = eval(selection.data) drop_info = treeview.get_dest_row_at_pos(x, y)