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

Closes #12731
(grafted from 00d2bb38f0b68c817b3c97b822c66ccda53855e4)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-11-11 19:31:35 +01:00
1 parent 1ffd45ca9c
commit 21bf2e841b
2 files changed
+16 -10

No files matched your search

+8 -5
View File
@@ -716,11 +716,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);
var 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
@@ -1444,11 +1444,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);
var 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');