summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2015-04-29 09:53:11 +0200
committerAaron Bohy <aab@odoo.com>2015-05-15 09:16:34 +0200
commitebd68aeb8322ee59c78fe843fd4ffb6c06d711e4 (patch)
tree881d941d3af51c8e72677146bf3e42d45c382269 /addons/web/static/src/js
parent4585ed840b5f19c144a5c0dbf759cfc395695251 (diff)
[FIX] web: prevent useless rpc in one2many
In some cases (for example, some popup dialogs with a form view), the one2many field is destroyed but the async code still tries to append a view manager to itself. The result is that the start method of the view manager is run, resulting in at least an useless fieldviewget.
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/form_relational_widgets.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js
index 7dacdb1d1fe..b8d0e33425d 100644
--- a/addons/web/static/src/js/views/form_relational_widgets.js
+++ b/addons/web/static/src/js/views/form_relational_widgets.js
@@ -850,7 +850,9 @@ var FieldOne2Many = AbstractManyField.extend({
});
});
$.async_when().done(function () {
- self.viewmanager.appendTo(self.$el);
+ if (!self.isDestroyed()) {
+ self.viewmanager.appendTo(self.$el);
+ }
});
return def;
},