[FIX] website_forum: fix tb on reflag of a post
Before this commit, a traceback was raise: Cannot read properties of undefined (reading 'displayNotification') Now, we correctly use self instead of this. task-2657621 closes odoo/odoo#77360 X-original-commit: ab65d077b7b4ec04155401902eb65418b4d2f415 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -300,12 +300,11 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onFlagAlertClick: function (ev) {
|
||||
var self = this;
|
||||
ev.preventDefault();
|
||||
var $link = $(ev.currentTarget);
|
||||
this._rpc({
|
||||
route: $link.data('href') || ($link.attr('href') !== '#' && $link.attr('href')) || $link.closest('form').attr('action'),
|
||||
}).then(function (data) {
|
||||
}).then(data => {
|
||||
if (data.error) {
|
||||
var message;
|
||||
if (data.error === 'anonymous_user') {
|
||||
@@ -342,12 +341,11 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onVotePostClick: function (ev) {
|
||||
var self = this;
|
||||
ev.preventDefault();
|
||||
var $btn = $(ev.currentTarget);
|
||||
this._rpc({
|
||||
route: $btn.data('href'),
|
||||
}).then(function (data) {
|
||||
}).then(data => {
|
||||
if (data.error) {
|
||||
var message;
|
||||
if (data.error === 'own_post') {
|
||||
|
||||
Reference in New Issue
Block a user