diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index cc108837f88..fe4579c8c25 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1038,6 +1038,12 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{ template: "EmptyComponent", // name displayed in view switchers display_name: '', + init: function(parent, dataset, view_id, options) { + this._super(parent); + this.dataset = dataset; + this.view_id = view_id; + this.set_default_options(options); + }, set_default_options: function(options) { this.options = options || {}; _.defaults(this.options, { diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 77bb6df4397..1a748e9cf91 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -6,8 +6,20 @@ var _t = openerp.web._t, _lt = openerp.web._lt; var QWeb = openerp.web.qweb; openerp.web.views.add('gantt', 'openerp.web_gantt.GanttView'); + openerp.web_gantt.GanttView = openerp.web.View.extend({ display_name: _lt('Gantt'), + template: "GanttView", + start: function() { + return this.rpc("/web/view/load", {"model": this.dataset.model, "view_id": this.view_id, "view_type": "gantt"}, this.on_loaded); + }, + on_loaded: function(data) { + this.fields_view = data; + }, +}); + +openerp.web_gantt.GanttViewOld = openerp.web.View.extend({ + display_name: _lt('Gantt'), init: function(parent, dataset, view_id) { this._super(parent); @@ -52,7 +64,7 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ return; } - this.$element.html(QWeb.render("GanttView", {'height': $('.oe-application-container').height(), 'width': $('.oe-application-container').width()})); + this.$element.html(QWeb.render("GanttViewOld", {'height': $('.oe-application-container').height(), 'width': $('.oe-application-container').width()})); this.has_been_loaded.resolve(); }, diff --git a/addons/web_gantt/static/src/xml/web_gantt.xml b/addons/web_gantt/static/src/xml/web_gantt.xml index 302ac2cfef9..2376c6243d8 100644 --- a/addons/web_gantt/static/src/xml/web_gantt.xml +++ b/addons/web_gantt/static/src/xml/web_gantt.xml @@ -1,6 +1,14 @@ - + + + + +
+ +
+
+ + + +
+ +