From a420046a52842c5ae93abcfd502f1bb4dfedac38 Mon Sep 17 00:00:00 2001 From: fw-bot Date: Fri, 23 Oct 2020 12:35:45 +0000 Subject: [PATCH] [FIX] website_mail_channel: fix load more replies On a thread with at least 21 replies, click on "show N more replies". The first time, it does the last 10 replies. Click again: it appends the same batch of 10 replies to the thread. The button loads the replies starting from the last reply id, but this id is not updated after load. This is because the code searches for a `p.well` in the DOM assumed to be the `o_mg_read_more` parent (see c40f184). However, commit 59237ea removed the `.well` class of the parent. The new button is not found, the old button is not removed, and so it goes. Forward-Port of 4536764ad52b5b closes odoo/odoo#60647 X-original-commit: 69dd830a15da2d7e43e6040e26d960d2e941002e Signed-off-by: Martin Trigaux (mat) --- .../static/src/js/website_mail_channel.js | 4 ++-- doc/cla/corporate/acsone.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/website_mail_channel/static/src/js/website_mail_channel.js b/addons/website_mail_channel/static/src/js/website_mail_channel.js index aab009898c8..30928d781dc 100644 --- a/addons/website_mail_channel/static/src/js/website_mail_channel.js +++ b/addons/website_mail_channel/static/src/js/website_mail_channel.js @@ -60,9 +60,9 @@ publicWidget.registry.websiteMailChannel = publicWidget.Widget.extend({ if ($threadContainer) { var $lastMsg = $threadContainer.find('li.media').last(); $(data).find('li.media').insertAfter($lastMsg); - $(data).find('p.well').appendTo($threadContainer); + $(data).find('.o_mg_read_more').parent().appendTo($threadContainer); } - var $showMore = $link.parents('p.well').first(); + var $showMore = $link.parent(); $showMore.remove(); return; }); diff --git a/doc/cla/corporate/acsone.md b/doc/cla/corporate/acsone.md index 30a8bd27ee1..6da52eaba18 100644 --- a/doc/cla/corporate/acsone.md +++ b/doc/cla/corporate/acsone.md @@ -29,3 +29,4 @@ François Honoré francois.honore@acsone.eu https://github.com/acsonefho Denis Robinet denis.robinet@acsone.eu https://github.com/RobinetDenisAcsone Benoit Aimont benoit.aimont@acsone.eu https://github.com/baimont Bejaoui Souheil souheil.bejaoui@acsone.eu https://github.com/sbejaoui +Nans Lefebvre nans.lefebvre@acsone.eu https://github.com/len-foss