[FIX]
authorVidhin Mehta (OpenERP) <vme@tinyerp.com>
Thu, 1 Nov 2012 07:04:18 +0000 (12:34 +0530)
committerVidhin Mehta (OpenERP) <vme@tinyerp.com>
Thu, 1 Nov 2012 07:04:18 +0000 (12:34 +0530)
bzr revid: vme@tinyerp.com-20121101070418-guunfniuhvgy8ot9

addons/web_view_editor/static/src/js/view_editor.js

index e0a0df5..354feae 100644 (file)
@@ -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;