From 647785331e7aceaab59a6639e53a107f0f08915b Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 25 Jan 2012 13:39:33 +0100 Subject: [PATCH] [imp] added edition of a task bzr revid: nicolas.vanhoren@openerp.com-20120125123933-kabfy3d6mhrjk3a7 --- addons/web_gantt/static/src/js/gantt.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 56992a42f74..a00ea87f0dc 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -28,6 +28,9 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ }, do_search: function (domains, contexts, group_bys) { var self = this; + self.last_domains = domains; + self.last_contexts = contexts; + self.last_group_bys = group_bys; // select the group by var n_group_bys = []; if (this.fields_view.arch.attrs.default_group_by) { @@ -51,6 +54,9 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ }); }); }, + reload: function() { + return this.do_search(this.last_domains, this.last_contexts, this.last_group_bys); + }, on_data_loaded: function(tasks, group_bys) { var self = this; $(".oe-gantt-view-view", this.$element).html(""); @@ -188,8 +194,17 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({ }); }, on_task_display: function(task) { - //TODO niv - console.log(task); + var self = this; + var pop = new openerp.web.form.FormOpenPopup(self); + pop.on_write_completed.add_last(function() { + self.reload(); + }); + pop.show_element( + self.dataset.model, + task.id, + null, + {} + ); }, });