summaryrefslogtreecommitdiff
path: root/addons/web_gantt/static/src/js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-01-24 17:52:25 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-01-24 17:52:25 +0100
commit92ecf6d22d78faa55b794d3d708bd72f4d03f9be (patch)
tree906608ec5f2607bfc55535586b8674cef38eff39 /addons/web_gantt/static/src/js
parent9490e8b0135854ad1753fb804d709844abbbfc00 (diff)
[fix] fixed problem with duration due to dhtmlx gantt view stupid conception
bzr revid: nicolas.vanhoren@openerp.com-20120124165225-vuzil06v4797vh9l
Diffstat (limited to 'addons/web_gantt/static/src/js')
-rw-r--r--addons/web_gantt/static/src/js/gantt.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js
index 04f1ad0835e..0763a2eb059 100644
--- a/addons/web_gantt/static/src/js/gantt.js
+++ b/addons/web_gantt/static/src/js/gantt.js
@@ -138,8 +138,8 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({
}
var duration = (task_stop.getTime() - task_start.getTime()) / (1000 * 60 * 60);
if (task.id == 23)
- console.log("loading", task.id, task_start.toString(), task_start.clone().addMilliseconds(duration * 60 * 60 * 1000).toString());
- var task_info = new GanttTaskInfo(_.uniqueId(), task_name, task_start, duration, 100);
+ console.log("loading", task.id, task_start.toString(), duration, task_start.clone().addMilliseconds(duration * 60 * 60 * 1000).toString());
+ var task_info = new GanttTaskInfo(_.uniqueId(), task_name, task_start, ((duration / 24) * 8), 100);
task_info.internal_task = task;
return {task_info: task_info, task_start: task_start, task_stop: task_stop};
}
@@ -162,8 +162,8 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({
var self = this;
var itask = task_obj.TaskInfo.internal_task;
var start = task_obj.getEST();
- var end = task_obj.getFinishDate();
- var duration = (end.getTime() - start.getTime()) / (1000 * 60 * 60);
+ var duration = (task_obj.getDuration() / 8) * 24;
+ var end = start.clone().addMilliseconds(duration * 60 * 60 * 1000);
console.log("saving", itask.id, start.toString(), end.toString());
var data = {};
data[self.fields_view.arch.attrs.date_start] =