From ffcd256d50ba9792e245d3ca507a6b408dcb7cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 21 Jun 2022 15:32:33 +0000 Subject: [PATCH] [IMP] mail: move _makeChatterContainerTarget code into caller Now that the method no longer requires an override in enterprise, it doesn't need to exist as a separate method. Part of task-2871070 Part-of: odoo/odoo#94188 --- .../widgets/form_renderer/form_renderer.js | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/addons/mail/static/src/widgets/form_renderer/form_renderer.js b/addons/mail/static/src/widgets/form_renderer/form_renderer.js index 69ea03d0af7..ab6737b2ac3 100644 --- a/addons/mail/static/src/widgets/form_renderer/form_renderer.js +++ b/addons/mail/static/src/widgets/form_renderer/form_renderer.js @@ -46,7 +46,13 @@ FormRenderer.include({ if (this._isFromFormViewDialog) { return $('
'); } - return this._makeChatterContainerTarget(); + if (!this._chatterContainerTarget) { + this._chatterContainerTarget = document.createElement("div"); + this._chatterContainerTarget.classList.add("o_FormRenderer_chatterContainer"); + } + this.$chatterContainerHook = $('
'); + this._updateChatterContainerTarget(); + return this.$chatterContainerHook; } return this._super(...arguments); }, @@ -140,23 +146,6 @@ FormRenderer.include({ threadModel: this.state.model, }; }, - /** - * Create the DOM element that will contain the chatter. This is made in - * a separate method so it can be overridden (like in mail_enterprise for - * example). - * - * @private - * @returns {jQuery.Element} - */ - _makeChatterContainerTarget() { - if (!this._chatterContainerTarget) { - this._chatterContainerTarget = document.createElement("div"); - this._chatterContainerTarget.classList.add("o_FormRenderer_chatterContainer"); - } - this.$chatterContainerHook = $('
'); - this._updateChatterContainerTarget(); - return this.$chatterContainerHook; - }, /** * Mount the chatter *