[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
This commit is contained in:
Sébastien Theys
2022-06-21 19:03:21 +02:00
parent 22293929c0
commit ffcd256d50
@@ -46,7 +46,13 @@ FormRenderer.include({
if (this._isFromFormViewDialog) {
return $('<div/>');
}
return this._makeChatterContainerTarget();
if (!this._chatterContainerTarget) {
this._chatterContainerTarget = document.createElement("div");
this._chatterContainerTarget.classList.add("o_FormRenderer_chatterContainer");
}
this.$chatterContainerHook = $('<div class="o_FormRenderer_chatterContainer"/>');
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 = $('<div class="o_FormRenderer_chatterContainer"/>');
this._updateChatterContainerTarget();
return this.$chatterContainerHook;
},
/**
* Mount the chatter
*