From 4c474eee914eb4452904d43bdbe3db5f4fc28c95 Mon Sep 17 00:00:00 2001 From: KolushovAlexandr Date: Mon, 30 Sep 2019 16:38:08 +0500 Subject: [PATCH 1/2] :ambulance: sent messages displaying issue --- mail_sent/__manifest__.py | 5 ++++- mail_sent/doc/changelog.rst | 5 +++++ mail_sent/static/src/js/sent.js | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mail_sent/__manifest__.py b/mail_sent/__manifest__.py index cbd2b48..969e07d 100644 --- a/mail_sent/__manifest__.py +++ b/mail_sent/__manifest__.py @@ -1,9 +1,12 @@ +# Copyright 2016 Ivan Yelizariev +# Copyright 2019 Kolushov Alexandr +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { "name": "Sentbox", "summary": """Quick way to find sent messages""", "category": "Discuss", "images": ['images/menu.png'], - "version": "12.0.1.1.0", + "version": "12.0.1.1.1", "author": "IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_sent/doc/changelog.rst b/mail_sent/doc/changelog.rst index ec5a45b..86790cb 100644 --- a/mail_sent/doc/changelog.rst +++ b/mail_sent/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.1.1` +------- + +- **Imp:** Not all channel messages are shown if page was refreshed on a channel screen + `1.1.0` ------- diff --git a/mail_sent/static/src/js/sent.js b/mail_sent/static/src/js/sent.js index 5a5b182..2cba48e 100644 --- a/mail_sent/static/src/js/sent.js +++ b/mail_sent/static/src/js/sent.js @@ -1,3 +1,6 @@ +/* # Copyright 2018 Artyom Losev + # Copyright 2019 Kolushov Alexandr + # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */ odoo.define('mail_sent.sent', function (require) { "use strict"; @@ -23,6 +26,18 @@ Manager.include({ }); } }, + + addMessage: function (data, options) { + var message = this.getMessage(data.id); + if (message) { + var current_threads = message._threadIDs; + var new_channels = data.channel_ids; + if (_.without(new_channels, ...current_threads).length) { + message._threadIDs = _.union(new_channels, current_threads); + } + } + return this._super(data, options); + }, }); SearchableThread.include({ From bd5fdd8d61f94990d065d0bfad35d38d8d8cfe0c Mon Sep 17 00:00:00 2001 From: KolushovAlexandr Date: Wed, 9 Oct 2019 08:52:17 +0500 Subject: [PATCH 2/2] :zap: adding sent messages to sent channel without page refreshing --- mail_sent/__manifest__.py | 2 +- mail_sent/doc/changelog.rst | 5 +++-- mail_sent/static/src/js/sent.js | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mail_sent/__manifest__.py b/mail_sent/__manifest__.py index 969e07d..903c86a 100644 --- a/mail_sent/__manifest__.py +++ b/mail_sent/__manifest__.py @@ -6,7 +6,7 @@ "summary": """Quick way to find sent messages""", "category": "Discuss", "images": ['images/menu.png'], - "version": "12.0.1.1.1", + "version": "12.0.1.2.0", "author": "IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko", "support": "apps@it-projects.info", diff --git a/mail_sent/doc/changelog.rst b/mail_sent/doc/changelog.rst index 86790cb..a413f7c 100644 --- a/mail_sent/doc/changelog.rst +++ b/mail_sent/doc/changelog.rst @@ -1,7 +1,8 @@ -`1.1.1` +`1.2.0` ------- -- **Imp:** Not all channel messages are shown if page was refreshed on a channel screen +- **Imp:** Messages sent in the discuss page are automatically added to sent channel +- **Fix:** Not all channel messages are shown if page was refreshed on a channel screen `1.1.0` ------- diff --git a/mail_sent/static/src/js/sent.js b/mail_sent/static/src/js/sent.js index 2cba48e..ab9c002 100644 --- a/mail_sent/static/src/js/sent.js +++ b/mail_sent/static/src/js/sent.js @@ -35,6 +35,9 @@ Manager.include({ if (_.without(new_channels, ...current_threads).length) { message._threadIDs = _.union(new_channels, current_threads); } + } else if (data.author_id && data.author_id[0] && odoo.session_info.partner_id && + data.author_id[0] === odoo.session_info.partner_id) { + data.channel_ids.push('mailbox_channel_sent'); } return this._super(data, options); },