diff --git a/tryton/gui/window/view_form/view/form_gtk/binary.py b/tryton/gui/window/view_form/view/form_gtk/binary.py index d9d4c19a78..d22e8325f6 100644 --- a/tryton/gui/window/view_form/view/form_gtk/binary.py +++ b/tryton/gui/window/view_form/view/form_gtk/binary.py @@ -116,7 +116,7 @@ class Binary(WidgetInterface): def sig_new(self, widget=None): filename = file_selection(_('Open...'), - parent=self.window) + parent=self.widget.get_toplevel()) if filename and self.field: self.field.set_client(self.record, base64.encodestring(open(filename, 'rb').read())) @@ -144,7 +144,8 @@ class Binary(WidgetInterface): if self.filename_field: filename = self.filename_field.get(self.record) filename = file_selection(_('Save As...'), filename=filename, - parent=self.window, action=gtk.FILE_CHOOSER_ACTION_SAVE) + parent=self.widget.get_toplevel(), + action=gtk.FILE_CHOOSER_ACTION_SAVE) if filename: with open(filename,'wb') as fp: fp.write(base64.decodestring(self.field.get(self.record))) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2many.py b/tryton/gui/window/view_form/view/form_gtk/many2many.py index fcdd3bb89f..bef11b06fb 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2many.py @@ -134,8 +134,9 @@ class Many2Many(WidgetInterface): return False if len(ids) != 1 or not value: win = WinSearch(self.attrs['relation'], sel_multi=True, ids=ids, - context=context, domain=domain, parent=self.window, - views_preload=self.attrs.get('views', {})) + context=context, domain=domain, + parent=self.widget.get_toplevel(), + views_preload=self.attrs.get('views', {})) ids = win.run() res_id = None @@ -159,7 +160,7 @@ class Many2Many(WidgetInterface): def _sig_edit(self): if self.screen.current_record: - win = WinForm(self.screen, self.window) + win = WinForm(self.screen, self.widget.get_toplevel()) if win.run(): self.screen.current_record.save() else: diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index 64bf2c9eed..d6d635ac7e 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -128,7 +128,7 @@ class Many2One(WidgetInterface): win = WinSearch(self.attrs['relation'], sel_multi=False, ids=ids, context=context, domain=domain, - parent=self.window, + parent=self.widget.get_toplevel(), views_preload=self.attrs.get('views', {})) ids = win.run() if ids: @@ -157,7 +157,7 @@ class Many2One(WidgetInterface): def sig_new(self, *args): self.focus_out = False screen = self.get_screen() - win = WinForm(screen, self.window, new=True) + win = WinForm(screen, self.widget.get_toplevel(), new=True) if win.run(): if screen.save_current(): value = (screen.current_record.id, @@ -173,7 +173,7 @@ class Many2One(WidgetInterface): if value: screen = self.get_screen() screen.load([self.field.get(self.record)]) - win = WinForm(screen, self.window) + win = WinForm(screen, self.widget.get_toplevel()) while win.run(): if screen.save_current(): value = (screen.current_record.id, @@ -214,7 +214,7 @@ class Many2One(WidgetInterface): win = WinSearch(self.attrs['relation'], sel_multi=False, ids=ids, context=context, - domain=domain, parent=self.window, + domain=domain, parent=self.widget.get_toplevel(), views_preload=self.attrs.get('views', {})) ids = win.run() if ids: diff --git a/tryton/gui/window/view_form/view/form_gtk/one2many.py b/tryton/gui/window/view_form/view/form_gtk/one2many.py index 1ce5222692..da281d56ed 100644 --- a/tryton/gui/window/view_form/view/form_gtk/one2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py @@ -241,7 +241,7 @@ class One2Many(WidgetInterface): self.screen.new(context=ctx) self.screen.current_view.widget.set_sensitive(True) else: - win = WinForm(self.screen, self.window, new=True, + win = WinForm(self.screen, self.widget.get_toplevel(), new=True, many=True, context=ctx) win.run() win.destroy() @@ -256,7 +256,7 @@ class One2Many(WidgetInterface): if not record.validate(fields): self.screen.display() return - win = WinForm(self.screen, self.window) + win = WinForm(self.screen, self.widget.get_toplevel()) win.run() win.destroy() diff --git a/tryton/gui/window/view_form/view/form_gtk/reference.py b/tryton/gui/window/view_form/view/form_gtk/reference.py index 56ae601f8d..e92718b668 100644 --- a/tryton/gui/window/view_form/view/form_gtk/reference.py +++ b/tryton/gui/window/view_form/view/form_gtk/reference.py @@ -156,7 +156,7 @@ class Reference(WidgetInterface): if not leave: screen = Screen(model, self.window, mode=['form']) screen.load([obj_id]) - win = WinForm(screen, self.window) + win = WinForm(screen, self.widget.get_toplevel()) if win.run(): if screen.save_current(): value = (screen.current_record.id, @@ -191,7 +191,7 @@ class Reference(WidgetInterface): return True win = WinSearch(model, sel_multi=False, ids=ids, context=context, - domain=domain, parent=self.window) + domain=domain, parent=self.widget.get_toplevel()) ids = win.run() if ids: self.field.set_client(self.record, (model, (ids[0], ''))) @@ -206,7 +206,7 @@ class Reference(WidgetInterface): if not model: return screen = Screen(model, self.window, mode=['form']) - win = WinForm(screen, self.window, new=True) + win = WinForm(screen, self.widget.get_toplevel(), new=True) if win.run(): if screen.save_current(): value = (screen.current_record.id,