-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.2.0", | ||
|
||
"author": "IT-Projects LLC, Ivan Yelizariev, Pavel Romanchenko", | ||
"support": "[email protected]", | ||
|
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"; | ||
|
||
|
@@ -23,6 +26,21 @@ 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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
} | ||
} 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'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Нет проверки, что сообщение имело получателя. Клиентская часть расходится с определением поля sent на сервере |
||
} | ||
return this._super(data, options); | ||
}, | ||
}); | ||
|
||
SearchableThread.include({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has to be tested