Reviewers: ced, Description: tryton: Directly select form view instead of going through each view when creating a new record.
Because of this the current record was sometimes set to screen.group[0] (in display method) and this record was edited instead of creating a new one. Please review this at http://codereview.tryton.org/439001/ Affected files: M tryton/gui/window/view_form/screen/screen.py Index: tryton/gui/window/view_form/screen/screen.py =================================================================== --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -426,12 +426,7 @@ and self.current_view.widget_tree.editable)) \ or self.current_view.view_type == 'graph'): prev_current_record = self.current_record - for i in xrange(len(self.views)): - self.switch_view() - if self.current_view.view_type == 'form': - break - if self.current_view.view_type != 'form': - return None + self.switch_view('form') if not prev_current_record and self.current_record: # new already called in switch_view return self.current_record -- tryton-dev@googlegroups.com mailing list