From 2106e3dd2ecd61096d7c7531c2f18b00fb30aeea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 20 Mar 2017 15:23:19 +0100 Subject: [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. --- addons/web_tour/static/src/js/debug_manager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'addons/web_tour/static/src/js/debug_manager.js') diff --git a/addons/web_tour/static/src/js/debug_manager.js b/addons/web_tour/static/src/js/debug_manager.js index 3a4726a4b1f..68aab63946b 100644 --- a/addons/web_tour/static/src/js/debug_manager.js +++ b/addons/web_tour/static/src/js/debug_manager.js @@ -19,9 +19,11 @@ DebugManager.include({ consume_tours: function () { var active_tours = get_active_tours(); if (active_tours.length > 0) { // tours might have been consumed meanwhile - this._rpc('web_tour.tour', 'consume') - .args([active_tours]) - .exec() + this._rpc({ + model: 'web_tour.tour', + method: 'consume', + args: [active_tours], + }) .then(function () { window.location.reload(); }); -- cgit v1.2.3