[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.
This commit is contained in:
Géry Debongnie
2015-05-15 09:16:34 +02:00
committed by Aaron Bohy
parent 4585ed840b
commit ebd68aeb83
@@ -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;
},