diff options
| author | Aaron Bohy <aab@odoo.com> | 2020-05-28 09:55:44 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-06-12 08:04:14 +0000 |
| commit | 26fe23201bb495176d14c15c8866e8fc72ca044c (patch) | |
| tree | d464bed68b4a9e5494869db375c0aea103d69350 /addons/mail/static/src/js/services | |
| parent | c4786fccfd23360a02e442c48ae2fb9f1e70aa4c (diff) | |
[IMP] web,*: properly define env in the frontend
*bus,mail
This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.
Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.
Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.
Diffstat (limited to 'addons/mail/static/src/js/services')
| -rw-r--r-- | addons/mail/static/src/js/services/mail_manager.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/services/mail_manager.js b/addons/mail/static/src/js/services/mail_manager.js index 04cc696d401..f52af585f94 100644 --- a/addons/mail/static/src/js/services/mail_manager.js +++ b/addons/mail/static/src/js/services/mail_manager.js @@ -1004,7 +1004,7 @@ var MailManager = AbstractService.extend({ _t("%d Messages"), this._outOfFocusUnreadMessageCounter ); - this.trigger_up('set_title_part', { + this.env.bus.trigger('set_title_part', { part: '_chat', title: tabTitle }); @@ -1048,12 +1048,14 @@ var MailManager = AbstractService.extend({ * @param {string} viewID */ _redirectToDocument: function (resModel, resID, viewID) { - this.do_action({ - type: 'ir.actions.act_window', - view_mode: 'form', - res_model: resModel, - views: [[viewID || false, 'form']], - res_id: resID, + this.env.bus.trigger('do-action', { + action: { + type: 'ir.actions.act_window', + view_mode: 'form', + res_model: resModel, + views: [[viewID || false, 'form']], + res_id: resID, + }, }); }, /** @@ -1345,7 +1347,7 @@ var MailManager = AbstractService.extend({ */ _onWindowFocus: function () { this._resetOutOfFocusUnreadMessageCounter(); - this.trigger_up('set_title_part', { part: '_chat' }); + this.env.bus.trigger('set_title_part', { part: '_chat' }); }, }); |
