Do not execute action on row active if there is no selected id

Closes #12731
(grafted from 00d2bb38f0b68c817b3c97b822c66ccda53855e4)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2023-11-11 19:31:35 +01:00
1 parent 49208f5e9f
commit 6e490d871e
2 files changed
+16 -10

No files matched your search

+8 -5
View File
@@ -778,11 +778,14 @@ var Sao = {
Sao.main_menu_row_activate = function() {
var screen = Sao.main_menu_screen;
// ids is not defined to prevent to add suffix
return Sao.Action.exec_keyword('tree_open', {
'model': screen.model_name,
'id': screen.get_id(),
}, null, false);
const id = screen.get_id();
if (id) {
// ids is not defined to prevent to add suffix
Sao.Action.exec_keyword('tree_open', {
'model': screen.model_name,
'id': screen.get_id(),
}, null, false);
}
};
Sao.menu = function(preferences) {
+8 -5
View File
@@ -1471,11 +1471,14 @@
default_row_activate: function() {
if ((this.current_view.view_type == 'tree') &&
(this.current_view.attributes.keyword_open == 1)) {
Sao.Action.exec_keyword('tree_open', {
'model': this.model_name,
'id': this.get_id(),
'ids': [this.get_id()]
}, this.local_context, false);
const id = this.get_id();
if (id) {
Sao.Action.exec_keyword('tree_open', {
'model': this.model_name,
'id': this.get_id(),
'ids': [this.get_id()]
}, this.local_context, false);
}
} else {
if (!this.modified()) {
this.switch_view('form');