From 3e92da43e1a79881c74b3b7fa5435c63ec6b6df2 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Wed, 13 Dec 2023 15:13:52 +0100 Subject: [PATCH] [FIX] web: clickall should not click on tablet mode views Before this commit, clickall was clicking on an app that redirect to a tablet mode view. The issue with this is that clickall don't know how to exit the view, so it was stuck in the view. This commit adds that view on the blacklist of clickall. Also, this commit adds an error message when clickall is stuck in a view. closes odoo/odoo#146216 X-original-commit: 8f365824c9dddacf1b3a40688a30c8498df3d5d4 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/webclient/clickbot/clickbot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/webclient/clickbot/clickbot.js b/addons/web/static/src/webclient/clickbot/clickbot.js index d40f934cdf0..008f3baf7f4 100644 --- a/addons/web/static/src/webclient/clickbot/clickbot.js +++ b/addons/web/static/src/webclient/clickbot/clickbot.js @@ -14,6 +14,7 @@ const BLACKLISTED_MENUS = [ "base.menu_third_party", // Open a new tab "event.menu_event_registration_desk", // there's no way to come back from this menu (tablet mode) "hr_attendance.menu_hr_attendance_kiosk_no_user_mode", // same here (tablet mode) + "mrp_workorder.menu_mrp_workorder_root", // same here (tablet mode) "account.menu_action_account_bank_journal_form", // Modal in an iFrame ]; // If you change this selector, adapt Studio test "Studio icon matches the clickbot selector" @@ -245,6 +246,9 @@ async function getNextApp() { await ensureAppsMenu(); apps = document.querySelectorAll(".o_navbar_apps_menu .dropdown-item"); } + if (apps.length === 0) { + throw new Error("No app found, it's possible that we are not on the home menu/app menu"); + } const app = apps[appIndex]; appIndex++; return app;