From 971ba44447898f1ba31a662025776ef1fbda3c99 Mon Sep 17 00:00:00 2001 From: x620 Date: Thu, 5 May 2016 18:22:59 +0500 Subject: [PATCH] [FIX] move function toggle() from sent.js to base.js [FIX] change summary in __openerp__.py --- mail_archives/__openerp__.py | 2 +- mail_base/static/src/js/base.js | 9 +++++++++ mail_sent/static/src/js/sent.js | 10 ++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/mail_archives/__openerp__.py b/mail_archives/__openerp__.py index 5995e02..30d9a94 100644 --- a/mail_archives/__openerp__.py +++ b/mail_archives/__openerp__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- { "name": "Mail archives", - "summary": """Adds menu to find sent/received messages""", + "summary": """Adds menu to find old messages""", "category": "Discuss", "images": [], "version": "1.0.0", diff --git a/mail_base/static/src/js/base.js b/mail_base/static/src/js/base.js index b578d14..12f1111 100644 --- a/mail_base/static/src/js/base.js +++ b/mail_base/static/src/js/base.js @@ -97,6 +97,15 @@ ChatAction.include({ } }); return result; + }, + set_channel: function(channel){ + var result = this._super.apply(this, arguments); + var self = this; + return $.when(result).done(function() { + self.$buttons + .find('.o_mail_chat_button_new_message') + .toggle(self.show_send_message_button.indexOf(channel.id) != -1); + }); } }); diff --git a/mail_sent/static/src/js/sent.js b/mail_sent/static/src/js/sent.js index a31d6fe..c84de74 100644 --- a/mail_sent/static/src/js/sent.js +++ b/mail_sent/static/src/js/sent.js @@ -19,15 +19,9 @@ var _lt = core._lt; var ChatAction = core.action_registry.get('mail.chat.instant_messaging'); ChatAction.include({ set_channel: function(channel){ - var result = this._super.apply(this, arguments); - // Add "Send message" button in the Sent menu + this._super.apply(this, arguments); + // Add channel Sent for show "Send message" button this.show_send_message_button.push('channel_sent'); - var self = this; - return $.when(result).done(function() { - self.$buttons - .find('.o_mail_chat_button_new_message') - .toggle(self.show_send_message_button.indexOf(channel.id) != -1); - }); }, get_thread_rendering_options: function (messages) { var options = this._super.apply(this, arguments);