summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2018-12-20 14:29:37 +0000
committerMartin Trigaux <mat@odoo.com>2019-01-04 10:16:06 +0000
commite24ab17d38fb049404f04112990e8b2fe1dd7727 (patch)
treefa2eb2f8dfc4e70c2f3740bbc26ab0eda47f1e34 /addons/web/static/src
parent0ecaf53726f43d6e42842ecf34fc74d661bf1d21 (diff)
[FIX] web: do not open first app if no app
On an instance with only web installed. A non-admin use had an error as trying to open the first app (which does not exists) closes odoo/odoo#29687
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome/apps_menu.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome/apps_menu.js b/addons/web/static/src/js/chrome/apps_menu.js
index f6535ed764c..eb7faaa971b 100644
--- a/addons/web/static/src/js/chrome/apps_menu.js
+++ b/addons/web/static/src/js/chrome/apps_menu.js
@@ -41,6 +41,9 @@ var AppsMenu = Widget.extend({
* Open the first app in the list of apps
*/
openFirstApp: function () {
+ if (!this._apps.length) {
+ return
+ }
var firstApp = this._apps[0];
this._openApp(firstApp);
},