[FIX] mail: rename direct message chat

Before this commit, when a direct message chat was renamed, it
crashed with the following error:

`TypeError: Cannot read property 'toLowerCase' of undefined`

This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.

Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.

closes odoo/odoo#34641

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
This commit is contained in:
Alexandre Kühn
2019-07-09 12:37:07 +00:00
parent 127ada424d
commit f9ead39f5f
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -168,9 +168,9 @@ var RenameConversationDialog = Dialog.extend({
kwargs: {
name: name,
}
}).then(function (updatedName) {
}).then(function () {
var channel = self.call('mail_service', 'getThread', self._channelID);
channel.setName(updatedName);
channel.setName(name);
self._callback();
});
},
+1 -1
View File
@@ -1507,7 +1507,7 @@ QUnit.test('rename DM conversation', function (assert) {
assert.step(args.method);
assert.strictEqual(args.args[0], 1);
assert.strictEqual(args.kwargs.name, "Demo");
return $.when("Demo");
return $.when();
}
return this._super.apply(this, arguments);
},