diff options
| author | Christophe Matthieu <chm@odoo.com> | 2018-02-05 16:55:15 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2018-02-08 15:46:00 +0100 |
| commit | b28ceec009e0e7fd7efa82177540ff7489112f5e (patch) | |
| tree | 99549377a9e6d7b602a7b754d95eeb2f3f2bfad7 /addons/web/static/tests/helpers/test_utils.js | |
| parent | 625a648f227325468981a9e4a51e80b44132a45f (diff) | |
[FIX] web: Views: always destroy BasicModel instances
Before this rev., it might happen that the parent of BasicModel instances
wasn't correctly set to the Controller instance. It was actually set to the
ActionManager instance, which is never destroyed. So when this happened,
the BasicModel instance wasn't destroyed when it's controller was.
Diffstat (limited to 'addons/web/static/tests/helpers/test_utils.js')
| -rw-r--r-- | addons/web/static/tests/helpers/test_utils.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/tests/helpers/test_utils.js b/addons/web/static/tests/helpers/test_utils.js index 2ff472335ef..15478d6dff6 100644 --- a/addons/web/static/tests/helpers/test_utils.js +++ b/addons/web/static/tests/helpers/test_utils.js @@ -174,6 +174,7 @@ function createAsyncView(params) { return view.getController(widget).then(function (view) { // override the view's 'destroy' so that it calls 'destroy' on the widget // instead, as the widget is the parent of the view and the mockServer. + view.__destroy = view.destroy; view.destroy = function () { // remove the override to properly destroy the view and its children // when it will be called the second time (by its parent) |
