Do not execute button if there is no current record for the screen

This commit is contained in:
Cédric Krier
2025-06-16 11:38:20 +02:00
parent b88d9004ef
commit bcb8fd1cd2
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -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();
@@ -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()