Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] Clickeverywhere functionality regressed #2592

Open
emiliesoutiras opened this issue Aug 17, 2023 · 1 comment
Open

[16.0] Clickeverywhere functionality regressed #2592

emiliesoutiras opened this issue Aug 17, 2023 · 1 comment
Labels

Comments

@emiliesoutiras
Copy link

Module

web_responsive

Describe the bug

Clickeverywhere does not work once this module is installed.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. on odoo with web_responsive module installed, launch debug mode
  2. open developper tools menu
  3. launch "Run click everywhere Test"

Expected behavior
The test stops after the first click on the menu without finding the application icons.

Additional context
The relevant code is in the clickbot.js file: https://github.com/odoo/odoo/blob/a6f8d9c512ffb816e18bb43a5efa510707877cf6/addons/web/static/src/webclient/clickbot/clickbot.js#L180

I've tested this modification, which fixes the problem, but I don't know how to override the JS cleanly in this module.

     /**
     * Make sure the apps menu is open (community only)
     */
    async function ensureAppsMenu() {
        /* FIX-ME : specific to work with web_responsive module */
        var isWebResponsive = document.querySelector(
            ".o_navbar_apps_menu .dropdown-toggle .fa-th-large"
        );
        var appsMenu = null;
        if (isWebResponsive) {
           appsMenu = document.querySelector(".o_navbar_apps_menu .o_app");
        } else {
            appsMenu = document.querySelector(".o_navbar_apps_menu .dropdown-menu");
        }
        if (!appsMenu) {
            const toggler = document.querySelector(
                ".o_navbar_apps_menu .dropdown-toggle"
            );
            await triggerClick(toggler, "apps menu toggle button");
            if (isWebResponsive) {
                await waitForCondition(() =>
                    document.querySelector(".o_navbar_apps_menu .o_app")
                );
            } else {
                await waitForCondition(() =>
                    document.querySelector(".o_navbar_apps_menu .dropdown-menu")
                );
            }
        }
    }
@emiliesoutiras emiliesoutiras changed the title Clickeverywhere functionality regressed [16.0] Clickeverywhere functionality regressed Aug 31, 2023
@emiliesoutiras
Copy link
Author

Let me come back to the subject, does anyone have an idea of how to go about overloading this Javascript? With directives, I'd be willing to propose a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant