From 0f75b8138fb3dd70511b2de0fa75b480bdb6b5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 9 Oct 2012 17:18:35 +0200 Subject: [PATCH] Fix next/previous in form view when there is no current record issue2788 review548003 (transplanted from bd5d0d004c19cd4fe33f3263b065d3fdba630130) --- tryton/gui/window/view_form/screen/screen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 0585979a4a..08ab95ebe3 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -682,7 +682,9 @@ class Screen(SignalEvent): store = view.store iter_ = store.get_iter(end) self.current_record = store.get_value(iter_, 0) - elif view.view_type == 'form' and self.current_record.group: + elif (view.view_type == 'form' + and self.current_record + and self.current_record.group): group = self.current_record.group record = self.current_record while group: @@ -724,7 +726,9 @@ class Screen(SignalEvent): store = view.store iter_ = store.get_iter(start) self.current_record = store.get_value(iter_, 0) - elif view.view_type == 'form' and self.current_record.group: + elif (view.view_type == 'form' + and self.current_record + and self.current_record.group): group = self.current_record.group record = self.current_record idx = group.index(record) - 1