Disable action and reload toolbar menu when there is no record

There is no action to execute without a record.

Closes #11929
This commit is contained in:
Cédric Krier committed 2025-09-23 11:37:19 +02:00
1 parent 457adf3ebc
commit 9b39b6f170
2 files changed
+5

No files matched your search

+3
View File
@@ -1564,6 +1564,9 @@
}
set_sensitive(button_id, position && can_be_sensitive);
}
for (let button_id of ['reload', 'action']) {
set_sensitive(button_id, record_id !== null);
}
set_sensitive(
'switch_',
(position || (view_type == 'form') || (next_view_type != 'form')) &&
+2
View File
@@ -628,6 +628,8 @@ class Form(TabContent):
b.attrs.get('keyword', 'action') == action_type
for b in self.screen.get_buttons())
set_sensitive(button_id, bool(position) and can_be_sensitive)
for button_id in ['reload', 'action']:
set_sensitive(button_id, record_id is not None)
set_sensitive(
'switch',
(position or view_type == 'form' or next_view_type != 'form')