diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 0c32ba27d6f..9ad3232d396 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -89,6 +89,7 @@ Main Features 'static/lib/jquery.expander/jquery.expander.js', 'static/src/js/mail.js', 'static/src/js/mail_followers.js', + 'static/src/js/many2many_tags_email.js', ], 'qweb': [ 'static/src/xml/mail.xml', diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9133e5de257..60a55e79393 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -5,6 +5,7 @@ openerp.mail = function (session) { var mail = session.mail = {}; openerp_mail_followers(session, mail); // import mail_followers.js + openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js /** * ------------------------------------------------------------ @@ -1628,7 +1629,24 @@ openerp.mail = function (session) { bind_events: function () { var self=this; - this.$(".oe_write_full").click(function(){ self.root.thread.compose_message.on_compose_fullmail(); }); + this.$(".oe_write_full").click(function (event) { + event.stopPropagation(); + var action = { + type: 'ir.actions.act_window', + res_model: 'mail.compose.message', + view_mode: 'form', + view_type: 'form', + action_from: 'mail.ThreadComposeMessage', + views: [[false, 'form']], + target: 'new', + context: { + 'default_model': '', + 'default_res_id': false, + 'default_content_subtype': 'html', + }, + }; + session.client.action_manager.do_action(action); + }); this.$(".oe_write_onwall").click(function(){ self.root.thread.on_compose_message(); }); } }); @@ -1644,17 +1662,6 @@ openerp.mail = function (session) { session.web.ComposeMessageTopButton = session.web.Widget.extend({ template:'mail.compose_message.button_top_bar', - init: function (parent, options) { - this._super.apply(this, options); - this.options = this.options || {}; - this.options.domain = this.options.domain || []; - this.options.context = { - 'default_model': false, - 'default_res_id': 0, - 'default_content_subtype': 'html', - }; - }, - start: function (parent, params) { var self = this; this.$el.on('click', 'button', self.on_compose_message ); @@ -1671,11 +1678,11 @@ openerp.mail = function (session) { action_from: 'mail.ThreadComposeMessage', views: [[false, 'form']], target: 'new', - context: _.extend(this.options.context, { - 'default_model': this.context.default_model, - 'default_res_id': this.context.default_res_id, + context: { + 'default_model': '', + 'default_res_id': false, 'default_content_subtype': 'html', - }), + }, }; session.client.action_manager.do_action(action); },