From 250f72d9601eeb254cf9d5f65a145183943feffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Thu, 30 Jun 2022 16:01:45 +0000 Subject: [PATCH] [IMP] mail: fix race condition in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Probably introduced in PR changing rendering of chatter in form renderer that changed timers in unfortunate situations. Open form view utils was missing an await on (chatter container) render, but the issue was not perceptible before. closes odoo/odoo#95003 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/models/notification_request_view.js | 2 +- addons/mail/static/tests/helpers/test_utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/models/notification_request_view.js b/addons/mail/static/src/models/notification_request_view.js index 13e0a707738..c7cd26be35f 100644 --- a/addons/mail/static/src/models/notification_request_view.js +++ b/addons/mail/static/src/models/notification_request_view.js @@ -28,7 +28,7 @@ registerModel({ * @returns {FieldCommand} */ _computePersonaImStatusIconView() { - return this.messaging.partnerRoot.isImStatusSet ? insertAndReplace() : clear(); + return this.messaging.partnerRoot && this.messaging.partnerRoot.isImStatusSet ? insertAndReplace() : clear(); }, }, fields: { diff --git a/addons/mail/static/tests/helpers/test_utils.js b/addons/mail/static/tests/helpers/test_utils.js index d9cf11d2443..bf2ac8d528f 100644 --- a/addons/mail/static/tests/helpers/test_utils.js +++ b/addons/mail/static/tests/helpers/test_utils.js @@ -564,7 +564,7 @@ async function start(param0 = {}) { pyEnv.mockServer = MockServer.currentMockServer; const openView = async (action, options) => { action['type'] = action['type'] || 'ir.actions.act_window'; - return doAction(webClient, action, { props: options }); + await afterNextRender(() => doAction(webClient, action, { props: options })); }; await waitUntilEventPromise; return {