diff --git a/sao/src/screen.js b/sao/src/screen.js index 3f8466bbdf..beecf7a3fb 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -2041,6 +2041,10 @@ } }; + if (!this.current_record) { + return; + } + if (this.current_view) { var selected_records = this.current_view.selected_records; this.current_view.set_value(); diff --git a/tryton/tryton/gui/window/view_form/screen/screen.py b/tryton/tryton/gui/window/view_form/screen/screen.py index 77abfd4101..52128bfebc 100644 --- a/tryton/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/tryton/gui/window/view_form/screen/screen.py @@ -1257,6 +1257,9 @@ class Screen: def button(self, button): 'Execute button on the selected records' + if not self.current_record: + return + if self.current_view: self.current_view.set_value() fields = self.current_view.get_fields()