summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/chrome/sidebar.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-03-20 15:23:19 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit2106e3dd2ecd61096d7c7531c2f18b00fb30aeea (patch)
tree1e41a2e698ba993d9d74b6fddd699adb15642001 /addons/web/static/src/js/chrome/sidebar.js
parent749d10e8b55dce94828290d7e4d6b2b6f741e9bd (diff)
[REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare the future and do it properly. This commit introduces the new rpc system, which replace the previous new one. We now simply have a method, this._rpc, which takes a dictionary of parameters. The idea is that depending on the parameters, it is able to add correct default value when necessary. For situations where we don't have the this._rpc method, we can use the rpc.query method, which takes the same arguments, but directly calls ajax.rpc instead of triggering up some events.
Diffstat (limited to 'addons/web/static/src/js/chrome/sidebar.js')
-rw-r--r--addons/web/static/src/js/chrome/sidebar.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/web/static/src/js/chrome/sidebar.js b/addons/web/static/src/js/chrome/sidebar.js
index 41e45b6e148..3cd17334e9e 100644
--- a/addons/web/static/src/js/chrome/sidebar.js
+++ b/addons/web/static/src/js/chrome/sidebar.js
@@ -148,13 +148,14 @@ var Sidebar = Widget.extend({
new Context(
sidebar_eval_context, active_ids_context));
- self._rpc("/web/action/load")
- .params({
- action_id: item.action.id,
- context: new Context(
- dataset.get_context(), active_ids_context).eval()
+ self._rpc({
+ route: '/web/action/load',
+ params: {
+ action_id: item.action.id,
+ context: new Context(
+ dataset.get_context(), active_ids_context).eval()
+ },
})
- .exec()
.done(function(result) {
result.context = new Context(
result.context || {}, active_ids_context)