[REM] remove instance.web.ViewManagerAction
authorGéry Debongnie <ged@odoo.com>
Fri, 17 Oct 2014 13:05:07 +0000 (15:05 +0200)
committerGéry Debongnie <ged@odoo.com>
Tue, 21 Oct 2014 07:33:52 +0000 (09:33 +0200)
ViewManager takes over all duties of ViewManagerAction, it can now be
safely removed.

addons/share/static/src/js/share.js
addons/web/static/src/js/views.js
addons/web/static/src/xml/base.xml
addons/web_view_editor/static/src/js/view_editor.js

index 2211295..530b07c 100644 (file)
@@ -94,7 +94,7 @@ openerp.share = function(session) {
         }
     });
 
-    session.web.ViewManagerAction.include({
+    session.web.ViewManager.include({
         start: function() {
             var self = this;
             this.check_if_action_is_defined();
index 4fe276a..47a56ca 100644 (file)
@@ -393,7 +393,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
 
         return this.ir_actions_common({
             widget: function () { 
-                return new instance.web.ViewManagerAction(self, action); 
+                return new instance.web.ViewManager(self, null, null, null, action); 
             },
             action: action,
             klass: 'oe_act_window',
@@ -494,7 +494,33 @@ instance.web.ViewManager =  instance.web.Widget.extend({
      * @param {Array} [views] List of [view_id, view_type]
      * @param {Object} [flags] various boolean describing UI state
      */
-    init: function(parent, dataset, views, flags) {
+    init: function(parent, dataset, views, flags, action) {
+        if (action) {
+            var flags = action.flags || {};
+            if (!('auto_search' in flags)) {
+                flags.auto_search = action.auto_search !== false;
+            }
+            if (action.res_model === 'board.board' && action.view_mode === 'form') {
+                action.target = 'inline';
+                // Special case for Dashboards
+                _.extend(flags, {
+                    views_switcher : false,
+                    display_title : false,
+                    search_view : false,
+                    pager : false,
+                    sidebar : false,
+                    action_buttons : false
+                });
+            }
+            this.action = action;
+            this.action_manager = parent;
+            var dataset = new instance.web.DataSetSearch(this, action.res_model, action.context, action.domain);
+            if (action.res_id) {
+                dataset.ids.push(action.res_id);
+                dataset.index = 0;
+            }
+            views = action.views;
+        }
         var self = this;
         this._super(parent);
 
@@ -917,37 +943,6 @@ instance.web.ViewManager =  instance.web.Widget.extend({
     },
 });
 
-instance.web.ViewManagerAction = instance.web.ViewManager.extend({
-    template:"ViewManagerAction",
-
-    init: function (parent, action) {
-        var flags = action.flags || {};
-        if (!('auto_search' in flags)) {
-            flags.auto_search = action.auto_search !== false;
-        }
-        if (action.res_model === 'board.board' && action.view_mode === 'form') {
-            action.target = 'inline';
-            // Special case for Dashboards
-            _.extend(flags, {
-                views_switcher : false,
-                display_title : false,
-                search_view : false,
-                pager : false,
-                sidebar : false,
-                action_buttons : false
-            });
-        }
-        this.action = action;
-        this.action_manager = parent;
-        var dataset = new instance.web.DataSetSearch(this, action.res_model, action.context, action.domain);
-        if (action.res_id) {
-            dataset.ids.push(action.res_id);
-            dataset.index = 0;
-        }
-        this._super(parent, dataset, action.views, flags);
-    }
-});
-
 instance.web.Sidebar = instance.web.Widget.extend({
     init: function(parent) {
         var self = this;
index 4ae1e09..9b0121f 100644 (file)
     <div class="oe-view-manager-header container-fluid">
         <div class="row">
             <div class="col-md-6 oe-header-title">
+                <div t-if="widget.session.debug" class="oe_debug_view btn-group btn-group-sm"/>
                 <ol class="oe-view-title breadcrumb" t-if="widget.flags.display_title !== false">
                 </ol>
             </div>
         </div>
     </div>
 </div>
-<t t-name="ViewManagerAction" t-extend="ViewManager">
-    <t t-jquery="ol.oe-view-title" t-operation="before">
-        <div t-if="widget.session.debug" class="oe_debug_view btn-group btn-group-sm"/>
-    </t>
-</t>
 <t t-name="ViewManagerDebug">
     <button type="button" class="btn btn-default dropdown-toggle fa fa-bug oe-view-manager-debug" data-toggle="dropdown"> <span class="caret"/>
     </button>
index 64c4306..6471e09 100644 (file)
@@ -1,7 +1,7 @@
 openerp.web_view_editor = function(instance) {
 var _t = instance.web._t;
 var QWeb = instance.web.qweb;
-instance.web.ViewManagerAction.include({
+instance.web.ViewManager.include({
     on_debug_changed:function(evt){
         var val = $(evt.target).data('action'),
             current_view = this.active_view.controller;