diff options
| author | Sébastien Theys <seb@odoo.com> | 2020-08-28 12:53:38 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2020-08-28 16:15:15 +0000 |
| commit | 17611f4adc5e950b0a75a2a6615b1da3c956387f (patch) | |
| tree | ede6cbc0bc67c1dceed3b5ca6c1bb3e08389675c /addons/snailmail | |
| parent | 5ba64925fd846e9a9a4884913e3d1004d05ecdf6 (diff) | |
[FIX] mail, *: fix opens and redirects, adapt messaging menu close
task-2244279
task-2262862
task-2274993
task-2277537
task-2282238
closes odoo/odoo#56745
X-original-commit: 109f202
Related: odoo/enterprise#12761
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/snailmail')
| -rw-r--r-- | addons/snailmail/static/src/models/notification_group/notification_group.js | 53 |
1 files changed, 29 insertions, 24 deletions
diff --git a/addons/snailmail/static/src/models/notification_group/notification_group.js b/addons/snailmail/static/src/models/notification_group/notification_group.js index c63ebe4c066..3fff33cbb01 100644 --- a/addons/snailmail/static/src/models/notification_group/notification_group.js +++ b/addons/snailmail/static/src/models/notification_group/notification_group.js @@ -15,18 +15,18 @@ registerInstancePatchModel('mail.notification_group', 'snailmail/static/src/mode * @override */ openCancelAction() { - if (this.notification_type === 'snail') { - this.env.bus.trigger('do-action', { - action: 'snailmail.snailmail_letter_cancel_action', - options: { - additional_context: { - default_model: this.res_model, - unread_counter: this.notifications.length, - }, - }, - }); + if (this.notification_type !== 'snail') { + return this._super(...arguments); } - return this._super(...arguments); + this.env.bus.trigger('do-action', { + action: 'snailmail.snailmail_letter_cancel_action', + options: { + additional_context: { + default_model: this.res_model, + unread_counter: this.notifications.length, + }, + }, + }); }, //-------------------------------------------------------------------------- @@ -37,20 +37,25 @@ registerInstancePatchModel('mail.notification_group', 'snailmail/static/src/mode * @override */ _openDocuments() { - if (this.notification_type === 'snail') { - this.env.bus.trigger('do-action', { - action: { - name: this.env._t("Snailmail Failures"), - type: 'ir.actions.act_window', - view_mode: 'kanban,list,form', - views: [[false, 'kanban'], [false, 'list'], [false, 'form']], - target: 'current', - res_model: this.res_model, - domain: [['message_ids.snailmail_error', '=', true]], - }, - }); + if (this.notification_type !== 'snail') { + return this._super(...arguments); + } + this.env.bus.trigger('do-action', { + action: { + name: this.env._t("Snailmail Failures"), + type: 'ir.actions.act_window', + view_mode: 'kanban,list,form', + views: [[false, 'kanban'], [false, 'list'], [false, 'form']], + target: 'current', + res_model: this.res_model, + domain: [['message_ids.snailmail_error', '=', true]], + }, + }); + if (this.env.messaging.device.isMobile) { + // messaging menu has a higher z-index than views so it must + // be closed to ensure the visibility of the view + this.env.messaging.messagingMenu.close(); } - return this._super(...arguments); }, }); |
