diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-06-27 14:23:03 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-06-27 14:25:00 +0200 |
| commit | 964b7c378f379da683175ac7aee2e4ecee481064 (patch) | |
| tree | 5fd3d27bfb14359e355199cb8ef296a38f8dee66 /addons/web | |
| parent | 9fbed63406702b43e41262da24d68f63feb582f0 (diff) | |
[FIX] web: apps: correctly use this._rpc
session.rpc should not be used anymore. The function '_rpc'
available on widgets should be used instead (with the correct
params).
Also, 'session' is no longer a widget attribute.
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/static/src/js/apps.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/addons/web/static/src/js/apps.js b/addons/web/static/src/js/apps.js index fcf21852d2c..b05de1d0756 100644 --- a/addons/web/static/src/js/apps.js +++ b/addons/web/static/src/js/apps.js @@ -83,13 +83,13 @@ var Apps = Widget.extend({ }); }, 'rpc': function(m) { - self.session.rpc.apply(self.session, m.args).then(function(r) { + return self._rpc({route: m.args[0], params: m.args[1]}).then(function(r) { var w = self.$ifr[0].contentWindow; w.postMessage({id: m.id, result: r}, client.origin); }); }, 'Model': function(m) { - return this._rpc({model: m.model, method: m.method, args: m.args}) + return self._rpc({model: m.model, method: m.args[0], args: m.args[1]}) .then(function(r) { var w = self.$ifr[0].contentWindow; w.postMessage({id: m.id, result: r}, client.origin); @@ -125,8 +125,8 @@ var Apps = Widget.extend({ type: 'ir.actions.client', tag: this.remote_action_tag, params: _.extend({}, this.params, { - db: this.session.db, - origin: this.session.origin, + db: session.db, + origin: session.origin, }) }; w.postMessage({type:'action', action: act}, client.origin); @@ -145,7 +145,10 @@ var Apps = Widget.extend({ def.resolve(); }, function() { self.do_warn(_t('Odoo Apps will be available soon'), _t('Showing locally available modules'), true); - return session.rpc('/web/action/load', {action_id: self.failback_action_id}).then(function(action) { + return self._rpc({ + route: '/web/action/load', + params: {action_id: self.failback_action_id}, + }).then(function(action) { return self.do_action(action); }).always(function () { def.reject(); |
