diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-08-30 09:24:31 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-08-30 11:23:29 +0200 |
| commit | 96b1db4cd44ab70c5a7014ee36a8b475e1c5e38a (patch) | |
| tree | 4eb626e03c6477adff1ca33151ad6af492496320 /addons/web/static/src | |
| parent | 551dc26940f2f33af7fa71c7d1256fe4f2f2fd8f (diff) | |
[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
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_controller.js | 1 |
1 files changed, 1 insertions, 0 deletions
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) { |
