From c01b9e7bddd24a30e0f6d1b4dca4d89daea69fb6 Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Mon, 5 Sep 2022 10:32:48 +0000 Subject: [PATCH] [FIX] mail: model manager is debug during tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the PR introducing the wowl environment in the discuss app, the model manager is not set in debug mode during tests. The debug mode is usefull since it adds integrity checks and more verbose error messages. This commit restores it. closes odoo/odoo#99556 Related: odoo/enterprise#31086 Signed-off-by: Alexandre Kühn (aku) --- .../mail/static/src/models/attachment_viewer_viewable.js | 9 --------- addons/mail/static/tests/helpers/webclient_setup.js | 5 +++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/addons/mail/static/src/models/attachment_viewer_viewable.js b/addons/mail/static/src/models/attachment_viewer_viewable.js index eeb5509cb06..dcf85674d42 100644 --- a/addons/mail/static/src/models/attachment_viewer_viewable.js +++ b/addons/mail/static/src/models/attachment_viewer_viewable.js @@ -15,12 +15,6 @@ registerModel({ download() { return this.attachmentOwner.download(); }, - /** - * @private - */ - _computeAccessToken() { - return this.attachmentOwner.accessToken; - }, /** * @private */ @@ -97,9 +91,6 @@ registerModel({ identifying: true, inverse: 'attachmentViewerViewable', }), - accessToken: attr({ - compute: "_computeAccessToken", - }), defaultSource: attr({ compute: "_computeDefaultSource", }), diff --git a/addons/mail/static/tests/helpers/webclient_setup.js b/addons/mail/static/tests/helpers/webclient_setup.js index 0fc6a3f415a..231ccc7b6b9 100644 --- a/addons/mail/static/tests/helpers/webclient_setup.js +++ b/addons/mail/static/tests/helpers/webclient_setup.js @@ -62,10 +62,11 @@ function setupMessagingServiceRegistries({ const serviceRegistry = registry.category('services'); patchWithCleanup(messagingService, { - async _startModelManager() { + async _startModelManager(modelManager, messagingValues) { + modelManager.isDebug = true; const _super = this._super.bind(this); await messagingBeforeCreationDeferred; - return _super(...arguments); + return _super(modelManager, messagingValues); }, });