Add missing context to pass to new call when switching view for issue1609

(transplanted from 6e20571014d26d1c56cfdb04f818684c5963723b)
This commit is contained in:
Cédric Krier committed 2010-07-22 20:05:27 +02:00
1 parent 07f07ba1a9
commit 7912f2b3d8
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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,