Browse Source

[FIX] Add parent_id field in options in mail_reply.js and and add parent_id parameter in context in base.js

pull/33/head
x620 8 years ago
parent
commit
3141b19eb2
  1. 11
      mail_base/static/src/js/base.js
  2. 24
      mail_reply/static/src/js/mail_reply.js

11
mail_base/static/src/js/base.js

@ -797,12 +797,15 @@ chat_manager.post_message = function (data, options) {
});
} else {
options.model = 'mail.compose.message';
options.res_id = msg.id;
var compose_model = new Model(options.model);
return compose_model.call('send_mail_action', [options.res_id], {
return compose_model.call('send_mail_action', [options.res_id, {
res_model: options.model,
res_id: options.res_id
});
res_id: options.res_id,
context: {
default_parent_id: options.parent_id
}
}]);
}
}
};

24
mail_reply/static/src/js/mail_reply.js

@ -16,6 +16,30 @@ ChatAction.include({
subject = "Re: " + message.subject;
}
this.extended_composer.set_subject(subject);
},
on_post_message: function(message){
var self = this;
var options = this.selected_message ? {} : {channel_id: this.channel.id};
if (this.selected_message) {
message.subtype = 'mail.mt_comment';
message.subtype_id = false;
message.message_type = 'comment';
message.content_subtype = 'html';
options.model = this.selected_message.model;
options.res_id = this.selected_message.res_id;
options.parent_id = this.selected_message.id;
}
base_obj.chat_manager
.post_message(message, options)
.then(function() {
if (self.selected_message) {
self.render_snackbar('mail.chat.MessageSentSnackbar', {record_name: self.selected_message.record_name}, 5000);
self.unselect_message();
} else {
self.thread.scroll_to();
}
});
}
});

Loading…
Cancel
Save