diff options
| author | ThanhDodeurOdoo <tso@odoo.com> | 2018-09-06 10:45:32 +0200 |
|---|---|---|
| committer | ThanhDodeurOdoo <tso@odoo.com> | 2018-09-13 11:50:26 +0200 |
| commit | d12b88315536150931b01e219c79b248b1fa9c40 (patch) | |
| tree | 677461f120e5e63e71d58c41368f46d0e8164840 /addons/mail/static/src/js/tools/debug_manager.js | |
| parent | 7f97c9fc056a0949c61c8444ee20f4c95bb3e9a9 (diff) | |
[IMP] mail, web: attachments & messages in debug actions.
- added two new actions to the form view debug action list,
both opens list (+ form) views of messages and attachments respectively
for which the domain is restricted to the current record.
task: 1860031
Diffstat (limited to 'addons/mail/static/src/js/tools/debug_manager.js')
| -rw-r--r-- | addons/mail/static/src/js/tools/debug_manager.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/tools/debug_manager.js b/addons/mail/static/src/js/tools/debug_manager.js new file mode 100644 index 00000000000..4c768e8bb2d --- /dev/null +++ b/addons/mail/static/src/js/tools/debug_manager.js @@ -0,0 +1,30 @@ +odoo.define('mail.DebugManager', function (require) { +"use strict"; + +var core = require('web.core'); +var DebugManager = require('web.DebugManager'); + +var _t = core._t; +/** + * adds a new method available for the debug manager, called by the "Manage Messages" button. + * + */ +DebugManager.include({ + getMailMessages: function () { + var self = this; + var selectedIDs = this._controller.getSelectedIds(); + if (!selectedIDs.length) { + console.warn(_t("No message available")); + return; + } + this.do_action({ + res_model: 'mail.message', + name: _t('Manage Messages'), + views: [[false, 'list'], [false, 'form']], + type: 'ir.actions.act_window', + domain: [['res_id', '=', selectedIDs[0]], ['model', '=', this._controller.modelName]], + }); + }, +}); + +}); |
