Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚑 sent messages displaying issue #229

Merged
merged 2 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mail_sent/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# 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": "[email protected]",
Expand Down
5 changes: 5 additions & 0 deletions mail_sent/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
`1.1.1`
-------

- **Imp:** Not all channel messages are shown if page was refreshed on a channel screen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has to be tested

`1.1.0`
-------

Expand Down
15 changes: 15 additions & 0 deletions mail_sent/static/src/js/sent.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* # Copyright 2018 Artyom Losev <https://it-projects.info/team/ArtyomLosev>
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
odoo.define('mail_sent.sent', function (require) {
"use strict";

Expand All @@ -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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'spread/rest operator' is only available in ES6 (use 'esversion: 6').

message._threadIDs = _.union(new_channels, current_threads);
}
}
return this._super(data, options);
},
});

SearchableThread.include({
Expand Down