[FIX] readd get_view_id to viewmanager (webclient)
authorGéry Debongnie <ged@odoo.com>
Tue, 4 Nov 2014 10:35:45 +0000 (11:35 +0100)
committerGéry Debongnie <ged@odoo.com>
Tue, 4 Nov 2014 12:15:43 +0000 (13:15 +0100)
it was removed in the refactoring of the action/viewmanager, but somehow
was not readded.  This is now done, and should prevent a few crashes.

addons/web/static/src/js/views.js

index 3c16119..1dc3d6b 100644 (file)
@@ -739,6 +739,12 @@ instance.web.ViewManager =  instance.web.Widget.extend({
         return this.switch_mode(view_type);
     },
     /**
+     * @returns {Number|Boolean} the view id of the given type, false if not found
+     */
+    get_view_id: function(view_type) {
+        return this.views[view_type] && this.views[view_type].view_id || false;
+    },    
+    /**
      * Sets up the current viewmanager's search view.
      *
      * @param {Number|false} view_id the view to use or false for a default one