diff --git a/addons/web_view_editor/static/src/js/view_editor.js b/addons/web_view_editor/static/src/js/view_editor.js index e0a0df5ab53..354feaeb28d 100644 --- a/addons/web_view_editor/static/src/js/view_editor.js +++ b/addons/web_view_editor/static/src/js/view_editor.js @@ -70,7 +70,17 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({ this.main_view_id = this.parent.fields_view.view_id; this.action_manager = new instance.web.ActionManager(this); this.action_manager.appendTo(this.view_edit_dialog.$el); - this.action_manager.do_action(action); + $.when(this.action_manager.do_action(action)).then(function() { + var viewmanager = self.action_manager.inner_widget; + var controller = viewmanager.views[viewmanager.active_view].controller; + controller.on('view_loaded', self, function(){ + $(controller.groups).bind({ + 'selected': function(e, ids, records) { + self.main_view_id = ids[0]; + } + }); + }); + }); }, on_create_view: function() { var self = this;