From 96b1db4cd44ab70c5a7014ee36a8b475e1c5e38a Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Wed, 30 Aug 2017 09:24:31 +0200 Subject: [FIX] web: prevent 'reload' event from being handled twice When the external button of a many2one field is clicked, the related record is opened in a dialog. When the user clicks on 'Save' in this dialog, a 'reload' event is triggered to reload the parent view (the one in the background), as the display name might have changed. However, when there is another many2one field in the opened dialog, and if its external button is clicked, there are 2 opened dialogs, and thus 3 nested form views. If the user clicks on 'Save' in the third one, only the direct parent view must be reloaded (the one in the first dialog). Before this rev., the 'reload' event wasn't stopPropagated, so it was handled by the view in the dialog, and by the one in the background, which produced a crash. This could happen for instance in Sales Order, edit a sale order line, click on the external button of the product, in the dialog, click on the external button of the category, edit some field and click on 'Save'. Closes #19052 --- addons/web/static/src/js/views/basic/basic_controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/views/basic/basic_controller.js') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 32570038987..67de3ec8ad9 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -539,6 +539,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * reload */ _onReload: function (event) { + event.stopPropagation(); // prevent other controllers from handling this request var data = event && event.data || {}; var handle = data.db_id; if (handle) { -- cgit v1.2.3