summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/component_extension.js4
-rw-r--r--addons/web/static/src/js/owl_compatibility.js4
-rw-r--r--addons/web/static/src/js/tools/test_menus.js17
3 files changed, 19 insertions, 6 deletions
diff --git a/addons/web/static/src/js/component_extension.js b/addons/web/static/src/js/component_extension.js
index ce9a3228569..4edaee807dd 100644
--- a/addons/web/static/src/js/component_extension.js
+++ b/addons/web/static/src/js/component_extension.js
@@ -13,12 +13,12 @@
return new Promise((resolve, reject) => {
return this.env.services.rpc(...arguments)
.then(result => {
- if (!this.__owl__.isDestroyed) {
+ if (this.__owl__.status !== 5 /* not destroyed */) {
resolve(result);
}
})
.catch(reason => {
- if (!this.__owl__.isDestroyed) {
+ if (this.__owl__.status !== 5) /* not destroyed */ {
reject(reason);
}
});
diff --git a/addons/web/static/src/js/owl_compatibility.js b/addons/web/static/src/js/owl_compatibility.js
index a33f5ebed58..b20ad7890f0 100644
--- a/addons/web/static/src/js/owl_compatibility.js
+++ b/addons/web/static/src/js/owl_compatibility.js
@@ -439,14 +439,14 @@ odoo.define('web.OwlCompatibility', function () {
* @return {Promise}
*/
async update(props = {}) {
- if (this.__owl__.isDestroyed) {
+ if (this.__owl__.status === 5 /* destroyed */) {
return new Promise(() => {});
}
Object.assign(this.props, props);
let prom;
- if (this.__owl__.isMounted) {
+ if (this.__owl__.status === 3 /* mounted */) {
prom = this.render();
} else {
// we may not be in the DOM, but actually want to be redrawn
diff --git a/addons/web/static/src/js/tools/test_menus.js b/addons/web/static/src/js/tools/test_menus.js
index 3b0523d8f65..9112b7f5961 100644
--- a/addons/web/static/src/js/tools/test_menus.js
+++ b/addons/web/static/src/js/tools/test_menus.js
@@ -106,6 +106,9 @@
console.log("Testing app menu:", element.dataset.menuXmlid);
if (testedApps.indexOf(element.dataset.menuXmlid) >= 0) return; // Another infinite loop protection
testedApps.push(element.dataset.menuXmlid);
+ if (isEnterprise) {
+ await ensureHomeMenu();
+ }
await testMenuItem(element);
if (appsMenusOnly === true) return;
const subMenuItems = document.querySelectorAll('.o_menu_entry_lvl_1, .o_menu_entry_lvl_2, .o_menu_entry_lvl_3, .o_menu_entry_lvl_4');
@@ -113,8 +116,7 @@
await testMenuItem(subMenuItem);
}
if (isEnterprise) {
- const homeMenu = document.querySelector('nav.o_main_navbar > a.o_menu_toggle.fa-th');
- return triggerClick(homeMenu, "home menu toggle button");
+ await ensureHomeMenu();
}
}
@@ -276,6 +278,17 @@
return promise;
}
+ /**
+ * Make sure the home menu is open
+ */
+ async function ensureHomeMenu() {
+ const menuToggle = document.querySelector('nav.o_main_navbar > a.o_menu_toggle.fa-th');
+ if (menuToggle) {
+ await triggerClick(menuToggle, 'home menu toggle button');
+ await waitForCondition(() => document.querySelector('.o_home_menu'));
+ }
+ }
+
const MOUSE_EVENTS = [
'mouseover',
'mouseenter',