diff --git a/sao/src/screen.js b/sao/src/screen.js index 85db45d234..0f496fd362 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -936,7 +936,7 @@ var views = this.views.concat(this.view_to_load) var next_view_index = (this.view_index + 1) % views.length; var next_view = views[next_view_index]; - if (typeof next_view != 'string') { + if (next_view && (typeof next_view != 'string')) { next_view = next_view.view_type; } return next_view; diff --git a/tryton/tryton/gui/window/view_form/screen/screen.py b/tryton/tryton/gui/window/view_form/screen/screen.py index 12b6c3042f..655da6c632 100644 --- a/tryton/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/tryton/gui/window/view_form/screen/screen.py @@ -547,7 +547,7 @@ class Screen: views = self.views + self.view_to_load next_view_index = (self.view_index + 1) % len(views) next_view = views[next_view_index] - if not isinstance(next_view, str): + if next_view and not isinstance(next_view, str): next_view = next_view.view_type return next_view