Remove infinite loop in screen new for issue103

This commit is contained in:
Cédric Krier committed 2008-06-09 08:27:30 +02:00
1 parent 41f42e8650
commit eaea0e4b28
1 file changed
+5 -1
+5 -1
View File
@@ -342,8 +342,12 @@ class Screen(SignalEvent):
and not (hasattr(self.current_view.widget_tree, 'editable') \
and self.current_view.widget_tree.editable)) \
or self.current_view.view_type == 'graph'):
while self.current_view.view_type != 'form':
for i in range(len(self.views)):
self.switch_view()
if self.current_view.view_type == 'form':
break
if self.current_view.view_type != 'form':
return None
ctx = self.context.copy()
ctx.update(context)
model = self.models.model_new(default, self.domain, ctx)