Browse Source

[FIX] Overrides chatter.js methods for show wizard in the form

pull/36/head
x620 9 years ago
parent
commit
862c251b58
  1. 26
      mail_move_message/static/src/js/mail_move_message.js

26
mail_move_message/static/src/js/mail_move_message.js

@ -23,6 +23,32 @@ odoo.define('mail_move_message.relocate', function (require) {
} }
}); });
var chatter = require('mail.Chatter');
chatter.include({
start: function() {
var result = this._super.apply(this, arguments);
this.thread.on('move_message', this, this.on_move_message);
return $.when(result).done(function() {});
},
on_move_message: function(message_id){
var action = {
name: _t('Relocate Message'),
type: 'ir.actions.act_window',
res_model: 'mail_move_message.wizard',
view_mode: 'form',
view_type: 'form',
views: [[false, 'form']],
target: 'new',
context: {'default_message_id': message_id}
};
this.do_action(action, {
'on_close': function(){}
});
}
});
var ChatAction = core.action_registry.get('mail.chat.instant_messaging'); var ChatAction = core.action_registry.get('mail.chat.instant_messaging');
ChatAction.include({ ChatAction.include({
start: function() { start: function() {

Loading…
Cancel
Save