diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-10-07 17:21:16 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2011-10-07 17:21:16 +0200 |
| commit | 9b7f1c581104bcda02bb33592ae6781b1ba4ac67 (patch) | |
| tree | 7b2c77ba103791f1a35a391926f1f483bea8c0ff /addons/web_graph/static/src | |
| parent | fc28192527761b027f63620952779d66740c8d8b (diff) | |
[imp] improved graph view to support o2m (not finished)
bzr revid: nicolas.vanhoren@openerp.com-20111007152116-r4ad6z4u035pjxgq
Diffstat (limited to 'addons/web_graph/static/src')
| -rw-r--r-- | addons/web_graph/static/src/js/graph.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index ffdec860906..04ebaa8991b 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -17,8 +17,9 @@ QWeb.add_template('/web_graph/static/src/xml/web_graph.xml'); openerp.web.views.add('graph', 'openerp.web_graph.GraphView'); openerp.web_graph.GraphView = openerp.web.View.extend({ - init: function(parent, dataset, view_id) { + init: function(parent, dataset, view_id, options) { this._super(parent); + this.set_default_options(options); this.dataset = dataset; this.view_id = view_id; @@ -37,17 +38,24 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ start: function() { var self = this; this._super(); + var loaded; + if (this.embedded_view) { + loaded = $.when([self.embedded_view]); + } else { + loaded = this.rpc('/web/view/load', { + model: this.dataset.model, + view_id: this.view_id, + view_type: 'graph' + }); + } return $.when( this.dataset.call('fields_get', []), - this.rpc('/web/view/load', { - model: this.dataset.model, - view_id: this.view_id, - view_type: 'graph' - })).then(function (fields_result, view_result) { + loaded) + .then(function (fields_result, view_result) { self.fields = fields_result[0]; self.fields_view = view_result[0]; self.on_loaded(); - }); + }); }, /** * Returns all object fields involved in the graph view |
