From 3d0773d963ed5b925849cff4799630ba6951e3bb Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Wed, 13 Jan 2021 09:45:07 +0000 Subject: [PATCH 1/2] [FIX] web: make OwlDialog patchable Allows customization for enterprise. Task ID: 2347640 X-original-commit: 127491b22e427587a3cdf88328826847fa881403 --- addons/web/static/src/js/core/owl_dialog.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/core/owl_dialog.js b/addons/web/static/src/js/core/owl_dialog.js index 3572742a698..62c6d239dda 100644 --- a/addons/web/static/src/js/core/owl_dialog.js +++ b/addons/web/static/src/js/core/owl_dialog.js @@ -1,6 +1,8 @@ -odoo.define('web.OwlDialog', function () { +odoo.define('web.OwlDialog', function (require) { "use strict"; + const patchMixin = require('web.patchMixin'); + const { Component, hooks, misc } = owl; const { Portal } = misc; const { useExternalListener, useRef } = hooks; @@ -269,5 +271,5 @@ odoo.define('web.OwlDialog', function () { }; Dialog.template = 'web.OwlDialog'; - return Dialog; + return patchMixin(Dialog); }); From a3f2a7b83ad87a2458602312475ee3e0ca67b261 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Thu, 14 Jan 2021 09:13:25 +0000 Subject: [PATCH 2/2] [FIX] web: make Popover patchable Allows customization for enterprise. Task ID: 2347640 X-original-commit: 5ac640611e21e6a7ac1c02e632e4550155c98f9a --- addons/web/static/src/js/core/popover.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/core/popover.js b/addons/web/static/src/js/core/popover.js index 6210ce940b5..d2102b56d3c 100644 --- a/addons/web/static/src/js/core/popover.js +++ b/addons/web/static/src/js/core/popover.js @@ -1,6 +1,8 @@ -odoo.define('web.Popover', function () { +odoo.define('web.Popover', function (require) { 'use strict'; + const patchMixin = require('web.patchMixin'); + const { Component, hooks, misc, QWeb } = owl; const { Portal } = misc; const { useRef, useState } = hooks; @@ -79,6 +81,10 @@ odoo.define('web.Popover', function () { this._hasGlobalEventListeners = true; } + _close() { + this.state.displayed = false; + } + /** * Computes the popover according to its props. This method will try to position the * popover as requested (according to the `position` props). If the requested position @@ -184,7 +190,7 @@ odoo.define('web.Popover', function () { if (this.popoverRef.el && this.popoverRef.el.contains(ev.target)) { return; } - this.state.displayed = false; + this._close(); } /** @@ -192,7 +198,7 @@ odoo.define('web.Popover', function () { * @param {Event} ev */ _onPopoverClose(ev) { - this.state.displayed = false; + this._close(); } /** @@ -312,5 +318,5 @@ odoo.define('web.Popover', function () { QWeb.registerComponent('Popover', Popover); - return Popover; + return patchMixin(Popover); });