From c2f910717a237709845fbb5afa85fb0c6787b44c Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 13 Mar 2018 11:18:37 +0100 Subject: [PATCH] [FIX] portal: dynamic chatter not editable 60c920d4a should solve duplication of chatter when editing the website. But portal module doesn't depends on website, so eg. on a instance with just helpdesk (and no website) we would not see the chatter on the frontend. This fix reverts 60c920d4a and adds another solution not depending on website. opw-1813792 closes #23614 --- addons/portal/static/src/js/portal_chatter.js | 20 ++++++------------- addons/portal/views/portal_templates.xml | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/addons/portal/static/src/js/portal_chatter.js b/addons/portal/static/src/js/portal_chatter.js index 3e17c5dd2b8..977a1576c77 100644 --- a/addons/portal/static/src/js/portal_chatter.js +++ b/addons/portal/static/src/js/portal_chatter.js @@ -5,7 +5,6 @@ var base = require('web_editor.base'); var ajax = require('web.ajax'); var core = require('web.core'); var Widget = require('web.Widget'); -var sAnimation = require('website.content.snippets.animation'); var rpc = require('web.rpc'); var time = require('web.time'); @@ -223,19 +222,12 @@ var PortalChatter = Widget.extend({ }, }); -sAnimation.registry.portal_chatter = sAnimation.Class.extend({ - selector: ".o_portal_chatter", - destroy: function () { - this.$target.empty(); - return this._super.apply(this, arguments); - }, - start: function () { - if (!this.editableMode) { - var mail_thread = new PortalChatter(null, this.$el.data()); - mail_thread.appendTo(this.$el); - } - return this._super.apply(this, arguments); - }, +base.ready().then(function () { + $('.o_portal_chatter').each(function (index) { + var $elem = $(this); + var mail_thread = new PortalChatter(null, $elem.data()); + mail_thread.appendTo($elem); + }); }); return { diff --git a/addons/portal/views/portal_templates.xml b/addons/portal/views/portal_templates.xml index 9095adb892d..2052ed27ced 100644 --- a/addons/portal/views/portal_templates.xml +++ b/addons/portal/views/portal_templates.xml @@ -349,7 +349,7 @@ the message will be posted with the identity of the partner_id of the object -->