From 9565e0506712e4490ffc654af46544d6b61db58b Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Mon, 23 Nov 2009 18:44:01 +0530 Subject: [PATCH] [IMP]:scrum 'in' to 'ANY' bzr revid: nch@tinyerp.com-20091123131401-gke5m4cq7ccxziqe --- addons/scrum/report/_burndown.py | 6 +++--- addons/scrum/report/task_burndown.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/scrum/report/_burndown.py b/addons/scrum/report/_burndown.py index fc7b60437ae..c4e8e67fc91 100644 --- a/addons/scrum/report/_burndown.py +++ b/addons/scrum/report/_burndown.py @@ -26,13 +26,13 @@ import time def compute_burndown(cr, uid, tasks_id, date_start, date_stop): latest = False if len(tasks_id): - cr.execute('select id,create_date,state,planned_hours from project_task where id in %s order by create_date',(tuple(tasks_id),)) + cr.execute('select id,create_date,state,planned_hours from project_task where id = ANY(%s) order by create_date',(tasks_id,)) tasks = cr.fetchall() - cr.execute('select w.date,w.hours from project_task_work w left join project_task t on (t.id=w.task_id) where t.id in %s and t.state in (%s,%s) order by date',(tuple(tasks_id),'open','progress',)) + cr.execute('select w.date,w.hours from project_task_work w left join project_task t on (t.id=w.task_id) where t.id = ANY(%s) and t.state in (%s,%s) order by date',(tasks_id,'open','progress',)) tasks2 = cr.fetchall() - cr.execute('select date_close,planned_hours from project_task where id in %s and state in (%s,%s) order by date_close' ,(tuple(tasks_id),'cancelled','done',)) + cr.execute('select date_close,planned_hours from project_task where id =ANY(%s) and state in (%s,%s) order by date_close' ,(tasks_id,'cancelled','done',)) tasks2 += cr.fetchall() tasks2.sort() else: diff --git a/addons/scrum/report/task_burndown.py b/addons/scrum/report/task_burndown.py index b4c6481ce48..668a746231f 100644 --- a/addons/scrum/report/task_burndown.py +++ b/addons/scrum/report/task_burndown.py @@ -43,9 +43,9 @@ class external_pdf(render): def burndown_chart(cr, uid, tasks_id, date_start, date_stop): latest = False - cr.execute('select id,date_start,state,planned_hours from project_task where id in %s order by date_start'(tuple(tasks_id),)) + cr.execute('select id,date_start,state,planned_hours from project_task where id = ANY(%s) order by date_start'(tasks_id,)) tasks = cr.fetchall() - cr.execute('select id,date_close,state,planned_hours*progress/100 from project_task where id in %s and state in (%s,%s) order by date_close', (tuple(tasks_id),'progress','done',)) + cr.execute('select id,date_close,state,planned_hours*progress/100 from project_task where id =ANY(%s) and state in (%s,%s) order by date_close', (tasks_id,'progress','done',)) tasks2 = cr.fetchall() current_date = date_start total = 0 @@ -72,14 +72,14 @@ class report_tasks(report_int): io = StringIO.StringIO() if 'date_start' not in datas: - cr.execute('select min(date_start) from project_task where id in %s',(tuple(ids),)) + cr.execute('select min(date_start) from project_task where id = ANY(%s)',(ids,)) dt = cr.fetchone()[0] if dt: datas['date_start'] = dt[:10] else: datas['date_start'] = time.strftime('%Y-%m-%d') if 'date_stop' not in datas: - cr.execute('select max(date_start),max(date_close) from project_task where id in %s',(tuple(ids),)) + cr.execute('select max(date_start),max(date_close) from project_task where id = ANY(%s)',(ids,)) res = cr.fetchone() datas['date_stop'] = (res[0] and res[0][:10]) or time.strftime('%Y-%m-%d') if res[1] and datas['date_stop']