From f98db923e27398b95cfcc1841d7723424fd28618 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Tue, 30 Nov 2021 13:52:09 +0000 Subject: [PATCH] [FIX] web_editor: fix module auto install with web The web_editor dependency with mail was problematic: - web_editor would not auto_intall without the mail being installed - A circular dependency problem with discuss In order to avoid creating a new module shared by mail and web editor, the use of a hack has been decided. By checking if `notification_type` is in the session, we ensure that the module mail is installed. Task-2698655 closes odoo/odoo#80640 X-original-commit: 4e611d7527f85fc074115bd018adb7d6e5ea2c53 Signed-off-by: David Monjoie (dmo) Co-authored-by: Antony Lesuisse --- addons/web_editor/__manifest__.py | 2 +- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py index c7f4ddadaef..f68bbd9dede 100644 --- a/addons/web_editor/__manifest__.py +++ b/addons/web_editor/__manifest__.py @@ -9,7 +9,7 @@ Odoo Web Editor widget. ========================== """, - 'depends': ['web', 'mail'], + 'depends': ['web'], 'data': [ 'security/ir.model.access.csv', 'data/editor_assets.xml', diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index affdb7cc48a..b54e3a04fb7 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -82,7 +82,11 @@ const Wysiwyg = Widget.extend({ const commands = this._getCommands(); let editorCollaborationOptions; - if (options.collaborationChannel) { + if ( + options.collaborationChannel && + // Hack: check if mail module is installed. + this.getSession()['notification_type'] + ) { editorCollaborationOptions = this.setupCollaboration(options.collaborationChannel); }