diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-05-09 12:26:50 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2017-05-09 17:03:30 +0200 |
| commit | 84187f972ac655ed5da4f3ab3ca9488454756f31 (patch) | |
| tree | 84e8087d7c5fb6bef89ebd4063a9dd656c8b818a /addons/web/static/src/js/views/view_dialogs.js | |
| parent | 136a119311eeab3cbe2f629a287685617369560b (diff) | |
[FIX] web: prevent view_dialogs from changing env
With this commit, we prevent view dialogs from changing the 'global'
environment in the view manager. Here is how it could cause a problem:
* open a form view for a bill of material
* click on one of the component, it will open a form view in a dialog
(and will change the environment with a wrong res_id)
* click on the many2one product -> it will open a new action in the
background, and change the environment again
* click on the breadcrumb to come back to the bill of material: the view
manager will try to restore the correct res_id (which is the wrong id
from the component form view), the form view will do a read (when
reloading the data), will get an empty result, will update its
information with no data, then will be in a wrong state which means
that the basicmodel will fetch a x2many with a wrong res_ids list
* boom
Diffstat (limited to 'addons/web/static/src/js/views/view_dialogs.js')
| -rw-r--r-- | addons/web/static/src/js/views/view_dialogs.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/view_dialogs.js b/addons/web/static/src/js/views/view_dialogs.js index d0c1fa75fdf..7e20cd74d04 100644 --- a/addons/web/static/src/js/views/view_dialogs.js +++ b/addons/web/static/src/js/views/view_dialogs.js @@ -19,6 +19,9 @@ var _t = core._t; var ViewDialog = Dialog.extend({ custom_events: _.extend({}, Dialog.prototype.custom_events, { push_state: '_onPushState', + env_updated: function (event) { + event.stopPropagation(); + }, }), /** * @constructor |
