diff options
| author | Géry Debongnie <ged@odoo.com> | 2015-01-30 16:24:51 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-01-30 16:24:51 +0100 |
| commit | 907c62f0ca1efd7f63733537e55cb4d7b85bd56f (patch) | |
| tree | 6b597140e2922169683fbf771f5807e7841a0304 /addons/web/static/src | |
| parent | 7dfceb8f7e141ca489be9f95687747b75aa111f9 (diff) | |
[FIX] web: correctly initialize view $containers
Problem could happen when clicking in views in dashboards. The $container
was looked up depth first when the view is created, but in some case,
it is wrong (the correct order is actually breadth first). A better way
to proceed is to get the reference when the view manager is created,
so we don't have the problem at all.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 3399a98af9f..e4a577321e7 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -630,6 +630,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ action : self.action, action_views_ids : views_ids, }, self.flags, self.flags[view.type], view.options); + view.$container = self.$(".oe-view-manager-view-" + view.type); // show options.$buttons as views will put their $buttons inside it // and call show/hide on them view.options.$buttons.show(); @@ -743,7 +744,7 @@ instance.web.ViewManager = instance.web.Widget.extend({ options.initial_mode = 'edit'; } var controller = new View(this, this.dataset, view.view_id, options), - $container = this.$(".oe-view-manager-view-" + view.type + ":first"); + $container = view.$container; $container.hide(); view.controller = controller; |
