changeset 2eb0a88f83b0 in tryton:4.0
details:
http://hg.tryton.org/tryton?cmd=changeset;node=2eb0a88f83b0
description:
Destroy import/export dialog after actually performing the action
To read the parameters encoded by the user, the dialog should still be there
otherwise it is the default values that used.
issue5677
review29331002
(grafted from 4dfab780d98448c07bcf813d165dfb0d7a88d575)
diffstat:
tryton/gui/window/win_export.py | 4 +---
tryton/gui/window/win_import.py | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diffs (38 lines):
diff -r 8ff52a03cf15 -r 2eb0a88f83b0 tryton/gui/window/win_export.py
--- a/tryton/gui/window/win_export.py Mon Jul 04 18:14:06 2016 +0200
+++ b/tryton/gui/window/win_export.py Thu Jul 07 10:30:24 2016 +0200
@@ -281,7 +281,6 @@
fields2.append(self.model2.get_value(iter, 0))
iter = self.model2.iter_next(iter)
action = self.saveas.get_active()
- self.destroy()
try:
data = RPCExecute('model', self.model, 'export_data',
self.ids, fields, context=self.context)
@@ -298,8 +297,7 @@
action=gtk.FILE_CHOOSER_ACTION_SAVE)
if fname:
self.export_csv(fname, fields2, data)
- else:
- self.destroy()
+ self.destroy()
def export_csv(self, fname, fields, data, popup=True):
encoding = self.csv_enc.get_active_text() or 'UTF-8'
diff -r 8ff52a03cf15 -r 2eb0a88f83b0 tryton/gui/window/win_import.py
--- a/tryton/gui/window/win_import.py Mon Jul 04 18:14:06 2016 +0200
+++ b/tryton/gui/window/win_import.py Thu Jul 07 10:30:24 2016 +0200
@@ -172,12 +172,10 @@
fields.append(self.model2.get_value(iter, 1))
iter = self.model2.iter_next(iter)
- self.destroy()
fname = self.import_csv_file.get_filename()
if fname:
self.import_csv(fname, fields)
- else:
- self.destroy()
+ self.destroy()
def import_csv(self, fname, fields):
# TODO: make it works with references