[IMP] mail: follower name in confirmation dialog on unfollow

Also fixing test so that it uses an existing follower.

Task-ID 1919551

closes odoo/odoo#31139

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Kaushalya Mandaliya
2019-04-15 11:27:02 +00:00
committed by Alexandre Kühn
parent 5a310619cb
commit b93ad321fe
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -248,8 +248,10 @@ var Followers = AbstractField.extend({
_unfollow: function (ids) {
var self = this;
return new Promise(function (resolve, reject) {
var text = _t("Warning! \n If you remove a follower, he won't be notified of any email or discussion on this document.\n Do you really want to remove this follower ?");
var follower = _.find(self.followers, { res_id: ids.partner_ids ? ids.partner_ids[0] : ids.channel_ids[0] });
var text = _.str.sprintf(_t("If you remove a follower, he won't be notified of any email or discussion on this document. Do you really want to remove %s?"), follower.name);
Dialog.confirm(this, text, {
title: _t("Warning"),
confirm_callback: function () {
var args = [
[self.res_id],
+1 -1
View File
@@ -2085,7 +2085,7 @@ QUnit.test('followers widget: follow/unfollow, edit subtypes', async function (a
assert.expect(24);
var resID = 2;
var partnerID = 1;
var partnerID = 2;
var followers = [];
var nbReads = 0;
var subtypes = [