diff --git a/tryton/gui/window/win_export.py b/tryton/gui/window/win_export.py index d9ffdd7ecf..1f17075825 100644 --- a/tryton/gui/window/win_export.py +++ b/tryton/gui/window/win_export.py @@ -148,9 +148,10 @@ class WinExport(WinCSV): def sig_unsel(self, *args): store, paths = self.view2.get_selection().get_selected_rows() - while paths: - store.remove(store.get_iter(paths[0])) - store, paths = self.view2.get_selection().get_selected_rows() + # Convert first into TreeIter before removing from the store + iters = [store.get_iter(p) for p in paths] + for i in iters: + store.remove(i) def sig_unsel_all(self, *args): self.model2.clear() diff --git a/tryton/gui/window/win_import.py b/tryton/gui/window/win_import.py index 4890078c30..2f99d75eea 100644 --- a/tryton/gui/window/win_import.py +++ b/tryton/gui/window/win_import.py @@ -157,9 +157,10 @@ class WinImport(WinCSV): def sig_unsel(self, *args): store, paths = self.view2.get_selection().get_selected_rows() - while paths: - store.remove(store.get_iter(paths[0])) - store, paths = self.view2.get_selection().get_selected_rows() + # Convert first into TreeIter before removing from the store + iters = [store.get_iter(p) for p in paths] + for i in iters: + store.remove(i) def sig_unsel_all(self, *args): self.model2.clear()