[FIX] mail: fix traceback in commands with body, commands don't linger
Commands that were expecting a body were not receiving one, and sending a command would not clear the text input. This commit fixes that. task-2645395 closes odoo/odoo#76516 X-original-commit: 3274452e41c2c3c097cea3cf24da68fc67b97eb5 Related: odoo/enterprise#20865 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
@@ -96,14 +96,14 @@ function factory(dependencies) {
|
||||
* @static
|
||||
* @param {Object} param0
|
||||
* @param {mail.thread} param0.channel
|
||||
* @param {Object} [param0.postData={}]
|
||||
* @param {Object} [param0.body='']
|
||||
*/
|
||||
async execute({ channel, postData = {} }) {
|
||||
async execute({ channel, body = '' }) {
|
||||
return this.env.services.rpc({
|
||||
model: 'mail.channel',
|
||||
method: this.methodName,
|
||||
args: [[channel.id]],
|
||||
kwargs: postData,
|
||||
kwargs: { body },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,10 @@ function factory(dependencies) {
|
||||
if (this.thread.model === 'mail.channel') {
|
||||
const command = this._getCommandFromText(this.textInputContent);
|
||||
if (command) {
|
||||
command.execute({ channel: this.thread, body: this.textInputContent });
|
||||
await command.execute({ channel: this.thread, body: this.textInputContent });
|
||||
if (this.exists()) {
|
||||
this._reset();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user