diff --git a/sao/src/sao.js b/sao/src/sao.js index aaf6c38267..0eef4845b3 100644 --- a/sao/src/sao.js +++ b/sao/src/sao.js @@ -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) { diff --git a/sao/src/screen.js b/sao/src/screen.js index b1e3f49cd8..96f8e11abd 100644 --- a/sao/src/screen.js +++ b/sao/src/screen.js @@ -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');