diff --git a/sao/src/sao.js b/sao/src/sao.js index 32be1d4784..b2cce94340 100644 --- a/sao/src/sao.js +++ b/sao/src/sao.js @@ -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) { diff --git a/sao/src/screen.js b/sao/src/screen.js index 3e380ce3a6..e217a1ae71 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -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');