diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 8902f6a827..31cb63df9b 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -327,7 +327,7 @@ class Screen(SignalEvent): def number_of_views(self): return len(self.views) + len(self.view_to_load) - def switch_view(self, view_type=None, default=True, context=None): + def switch_view(self, view_type=None): if not self.parent and self.modified(): return self.current_view.set_value() @@ -353,8 +353,6 @@ class Screen(SignalEvent): elif self.current_view.view_type == view_type: break self.screen_container.set(self.current_view.widget) - if not self.current_record and self.current_view.view_type == 'form': - self.new(default=default) self.current_view.cancel() self.display() self.set_cursor() diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index c87eae419b..48ddf04176 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -27,15 +27,12 @@ class WinForm(NoModal): self.save_current = save_current self.prev_view = self.screen.current_view self.screen.screen_container.alternate_view = True - switch_new = False - if view_type == 'form' and not self.screen.current_record: - switch_new = True if view_type not in (x.view_type for x in self.screen.views) and \ view_type not in self.screen.view_to_load: self.screen.add_view_id(None, view_type) else: - self.screen.switch_view(view_type=view_type, context=context) - if new and not switch_new: + self.screen.switch_view(view_type=view_type) + if new: self.screen.new() self.win = gtk.Dialog(_('Link'), self.parent, gtk.DIALOG_DESTROY_WITH_PARENT)