[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:
@@ -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();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user