Reviewers: ,


Please review this at http://codereview.tryton.org/578002/

Affected files:
  M tryton/gui/window/win_export.py


Index: tryton/gui/window/win_export.py
===================================================================

--- a/tryton/gui/window/win_export.py
+++ b/tryton/gui/window/win_export.py
@@ -191,6 +191,7 @@

         self.view1.set_model(self.model1)
         self.view2.set_model(self.model2)
+        self.view2.set_reorderable(True)

         self.wid_action = combo_saveas
         self.wid_write_field_names = checkbox_add_field_names
@@ -263,9 +264,10 @@
         relation = self.fields[store.get_value(iter, 1)][1]
         if relation:
             return
-        num = self.model2.append()
-        name = self.fields_data[store.get_value(iter, 1)]['string']
-        self.model2.set(num, 0, name, 1, store.get_value(iter, 1))
+        selected_column = store.get_value(iter, 1)
+        name = self.fields_data[selected_column]['string']
+        if name not in [n for n, _ in self.model2]:
+            self.model2.append((name, selected_column))

     def sig_unsel(self, widget=None):
         store, paths = self.view2.get_selection().get_selected_rows()



--
tryton-dev@googlegroups.com mailing list

Reply via email to