summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_tree.js
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-12-04 17:39:48 +0100
committerFabien Meghazi <fme@openerp.com>2012-12-04 17:39:48 +0100
commit58b44d50824d082aec6ef05742823a8da7a65e14 (patch)
tree70d7919063cb94bfb2e03c69296b6c57f39e2cbd /addons/web/static/src/js/view_tree.js
parentae53b85d90fe3e1644d0f44d49bae75f38e95709 (diff)
[IMP] Removed fields_view_get from controllers. Add a helper client side.
bzr revid: fme@openerp.com-20121204163948-pctxvy55w34e1pg9
Diffstat (limited to 'addons/web/static/src/js/view_tree.js')
-rw-r--r--addons/web/static/src/js/view_tree.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index 4d08da385fd..a68b92bc33a 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -9,6 +9,7 @@ var QWeb = instance.web.qweb,
instance.web.views.add('tree', 'instance.web.TreeView');
instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeView# */{
display_name: _lt('Tree'),
+ view_type: 'tree',
/**
* Indicates that this view is not searchable, and thus that no search
* view should be displayed (if there is one active).
@@ -36,18 +37,9 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
this.options = _.extend({}, this.defaults, options || {});
_.bindAll(this, 'color_for');
+ this.on('view_loaded', self, self.load_tree);
},
- start: function () {
- return this.rpc("/web/treeview/load", {
- model: this.model,
- view_id: this.view_id,
- view_type: "tree",
- toolbar: this.view_manager ? !!this.view_manager.sidebar : false,
- context: instance.web.pyeval.eval(
- 'context', this.dataset.get_context())
- }).done(this.on_loaded);
- },
/**
* Returns the list of fields needed to correctly read objects.
*
@@ -64,7 +56,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
}
return fields;
},
- on_loaded: function (fields_view) {
+ load_tree: function (fields_view) {
var self = this;
var has_toolbar = !!fields_view.arch.attrs.toolbar;
// field name in OpenERP is kinda stupid: this is the name of the field