From 8e8c98bf0c0fc4dd35fdb5009f68281425a8c9c2 Mon Sep 17 00:00:00 2001 From: Aaron Bohy <aab@odoo.com> Date: Tue, 27 Sep 2016 15:31:49 +0200 Subject: [PATCH] [ADD] web: handle custom_events perform(_model)_rpc If those events are catched by the web_client, it means that no other widget did handle them, so simply call their on_fail callback. --- addons/web/static/src/js/abstract_web_client.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/web/static/src/js/abstract_web_client.js b/addons/web/static/src/js/abstract_web_client.js index e6dab38f61c3..115a58a654f5 100644 --- a/addons/web/static/src/js/abstract_web_client.js +++ b/addons/web/static/src/js/abstract_web_client.js @@ -33,6 +33,16 @@ var WebClient = Widget.extend({ current_action_updated: function (e) { this.current_action_updated(e.data.action); }, + perform_rpc: function(event) { + if (event.data.on_fail) { + event.data.on_fail(); + } + }, + perform_model_rpc: function(event) { + if (event.data.on_fail) { + event.data.on_fail(); + } + }, }, init: function(parent) { this.client_options = {}; -- GitLab