diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index d86b829bf6..88f03e626d 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -243,7 +243,7 @@ class Screen(SignalEvent): self.group.signal_unconnect(self) del self.views - def switch_view(self, view_type=None): + def switch_view(self, view_type=None, default=True, context=None): self.current_view.set_value() if self.current_record and self.current_record not in self.group: self.current_record = None @@ -267,7 +267,7 @@ class Screen(SignalEvent): self.current_record.validate_set() else: if self.current_view.view_type == 'form': - self.new() + self.new(default=default, context=context) self.current_view.cancel() self.display(set_cursor=True) diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index f55de179bc..89534cb9e6 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -27,7 +27,7 @@ class WinForm(object): view_type not in self.screen.view_to_load: self.screen.add_view_id(False, view_type, display=True) else: - self.screen.switch_view(view_type=view_type) + self.screen.switch_view(view_type=view_type, context=context) if new and not switch_new: self.screen.new(context=self.context) self.win = gtk.Dialog(_('Link'), parent,