summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorXavierDo <xdo@odoo.com>2018-06-26 11:17:21 +0200
committerXavierDo <xdo@odoo.com>2018-07-11 12:25:33 +0200
commit62591c58f8abded96b5fedcc4d9760550b7bdf18 (patch)
treec4e607fc4bf7498ce838fb7faf619b4a4c605c07 /addons/mail/static/src
parent1b323e8b173e622adebdf2c6c2df8de759d83714 (diff)
[FIX] mail: add ability to mark failure notification as read
The mark as read button was not working for mail failure. More than that, we wanted a functionnality to be able to massively mark mail failure as canceled, especially to be able to clean databases from failure after migration. Task: #1860054 PR: #25622
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/systray.js9
-rw-r--r--addons/mail/static/src/xml/discuss.xml2
2 files changed, 10 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/systray.js b/addons/mail/static/src/js/systray.js
index 18e9511cf25..f354d2ec6f7 100644
--- a/addons/mail/static/src/js/systray.js
+++ b/addons/mail/static/src/js/systray.js
@@ -207,6 +207,15 @@ var MessagingMenu = Widget.extend({
var model = $(ev.currentTarget).data('model');
var domain = [['model', '=', model], ['res_id', '=', resID]];
this.call('chat_manager', 'markAllAsRead', channel, domain);
+ } else if (channelID === 'mail_failure') {
+ var unread_counter = $(ev.currentTarget).data('unread_counter');
+ var model = $(ev.currentTarget).data('model');
+ this.do_action('mail.mail_resend_cancel_action', {
+ additional_context: {
+ default_model: model,
+ unread_counter: unread_counter
+ }
+ });
} else {
this.call('chat_manager', 'markChannelAsSeen', channel);
}
diff --git a/addons/mail/static/src/xml/discuss.xml b/addons/mail/static/src/xml/discuss.xml
index 1eda1dfec1b..f1fef247c7c 100644
--- a/addons/mail/static/src/xml/discuss.xml
+++ b/addons/mail/static/src/xml/discuss.xml
@@ -237,7 +237,7 @@
</t>
<t t-raw="channel.last_message_preview"/>
</div>
- <span t-att-data-channel_id="channel.id" t-att-data-res_id="channel.res_id" t-att-data-model="channel.model" title="Mark as Read" class="o_discuss_icon o_mail_channel_mark_read fa fa-check" t-if="channel.unread_counter"/>
+ <span t-att-data-channel_id="channel.id" t-att-data-res_id="channel.res_id" t-att-data-model="channel.model" t-att-data-unread_counter="channel.unread_counter" title="Mark as Read" class="o_discuss_icon o_mail_channel_mark_read fa fa-check" t-if="channel.unread_counter"/>
</div>
</div>
</t>