From 7a6301cd5365960c81617effec8792e008e4b694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Dec 2014 22:26:09 +0100 Subject: [PATCH] Don't fail while autodetecting invalid field in import window on_row_expanded could be called on node without children by sig_autodetect, in such case the returned child is an invalid GtkTreeIter. So it must ignore such case to let sig_autodetect popup an error message. issue4313 review7791002 --- tryton/gui/window/win_import.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tryton/gui/window/win_import.py b/tryton/gui/window/win_import.py index 03b38d39b6..aff8d38ae9 100644 --- a/tryton/gui/window/win_import.py +++ b/tryton/gui/window/win_import.py @@ -238,6 +238,9 @@ class WinImport(NoModal): def on_row_expanded(self, treeview, iter, path): child = self.model1.iter_children(iter) + # autodetect could call for node without children + if child is None: + return if self.model1.get_value(child, 0) is None: prefix_field = self.model1.get_value(iter, 1) name, model = self.fields[prefix_field]