diff --git a/mail_archives/__manifest__.py b/mail_archives/__manifest__.py index 4c9fbcb..a244f85 100644 --- a/mail_archives/__manifest__.py +++ b/mail_archives/__manifest__.py @@ -1,9 +1,11 @@ +# Copyright 2020 Denis Mudarisov +# License MIT (https://opensource.org/licenses/MIT). { "name": "Mail archives", "summary": """Adds menu to find old messages""", "category": "Discuss", "images": ["images/1.jpg"], - "version": "11.0.1.0.0", + "version": "11.0.1.0.1", "author": "IT-Projects LLC, Pavel Romanchenko", "support": "apps@itpp.dev", "website": "https://it-projects.info", diff --git a/mail_archives/doc/changelog.rst b/mail_archives/doc/changelog.rst index 9ee2b48..caf6826 100644 --- a/mail_archives/doc/changelog.rst +++ b/mail_archives/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.0.1` +------- + +- **Fix:** adaptation to changes in `mail_base` + `1.0.0` ------- diff --git a/mail_archives/static/src/js/archives.js b/mail_archives/static/src/js/archives.js index c00f44f..9bb4d8a 100644 --- a/mail_archives/static/src/js/archives.js +++ b/mail_archives/static/src/js/archives.js @@ -1,4 +1,7 @@ -odoo.define("mail_archives.archives", function(require) { +/* Copyright 2020 Denis Mudarisov + * License MIT (https://opensource.org/licenses/MIT). */ + +odoo.define("mail_archives.archives", function (require) { "use strict"; var core = require("web.core"); @@ -9,14 +12,14 @@ odoo.define("mail_archives.archives", function(require) { var ChatAction = core.action_registry.get("mail.chat.instant_messaging"); ChatAction.include({ - init: function(parent, action, options) { + init: function (parent, action, options) { this._super.apply(this, arguments); var channel_name = "channel_archive"; // Add channel Archive for enable "display_subject" option this.channels_display_subject.push(channel_name); }, - update_message_on_current_channel: function(current_channel_id, message) { + update_message_on_current_channel: function (current_channel_id, message) { var result = this._super.apply(this, arguments); var archive = current_channel_id === "channel_archive" && !message.is_archive; @@ -24,51 +27,51 @@ odoo.define("mail_archives.archives", function(require) { }, }); - // Inherit class and override methods + chat_manager.is_ready.then(function () { + // Inherit class and override methods - var chat_manager_super = _.clone(chat_manager); + var chat_manager_super = _.clone(chat_manager); - chat_manager.get_properties = function(msg) { - var properties = chat_manager_super.get_properties.apply(this, arguments); - properties.is_archive = this.property_descr("channel_archive", msg, this); - return properties; - }; + chat_manager.get_properties = function (msg) { + var properties = chat_manager_super.get_properties.apply(this, arguments); + properties.is_archive = this.property_descr("channel_archive", msg, this); + return properties; + }; - chat_manager.set_channel_flags = function(data, msg) { - chat_manager_super.set_channel_flags.apply(this, arguments); - // Get recipients ids - var recipients_ids = []; - for (var i = 0; i < (data.partner_ids || []).length; i++) { - recipients_ids.push(data.partner_ids[i][0]); - } + chat_manager.set_channel_flags = function (data, msg) { + chat_manager_super.set_channel_flags.apply(this, arguments); + // Get recipients ids + var recipients_ids = []; + for (var i = 0; i < (data.partner_ids || []).length; i++) { + recipients_ids.push(data.partner_ids[i][0]); + } - // If author or recipient - if ( - data.author_id[0] === session.partner_id || - recipients_ids.indexOf(session.partner_id) !== -1 - ) { - msg.is_archive = true; - } + // If author or recipient + if ( + data.author_id[0] === session.partner_id || + recipients_ids.indexOf(session.partner_id) !== -1 + ) { + msg.is_archive = true; + } - return msg; - }; + return msg; + }; - chat_manager.get_channel_array = function(msg) { - var arr = chat_manager_super.get_channel_array.apply(this, arguments); - return arr.concat("channel_archive"); - }; + chat_manager.get_channel_array = function (msg) { + var arr = chat_manager_super.get_channel_array.apply(this, arguments); + return arr.concat("channel_archive"); + }; - chat_manager.get_domain = function(channel) { - return channel.id === "channel_archive" - ? [ - "|", - ["partner_ids", "in", [session.partner_id]], - ["author_id", "in", [session.partner_id]], - ] - : chat_manager_super.get_domain.apply(this, arguments); - }; + chat_manager.get_domain = function (channel) { + return channel.id === "channel_archive" + ? [ + "|", + ["partner_ids", "in", [session.partner_id]], + ["author_id", "in", [session.partner_id]], + ] + : chat_manager_super.get_domain.apply(this, arguments); + }; - chat_manager.is_ready.then(function() { chat_manager.add_channel({ id: "channel_archive", name: _lt("Archive"), diff --git a/mail_archives/static/src/xml/menu.xml b/mail_archives/static/src/xml/menu.xml index 155d809..bb6b845 100644 --- a/mail_archives/static/src/xml/menu.xml +++ b/mail_archives/static/src/xml/menu.xml @@ -7,9 +7,10 @@ t-attf-class="o_mail_chat_channel_item o_mail_chat_title_main #{(active_channel_id == 'channel_archive') ? 'o_active': ''}" data-channel-id="channel_archive" > - Archive + + + Archive +