From 9b30b73b0833fb2f8612be8196438cd3f8def913 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 29 Jan 2009 01:07:53 +0100 Subject: [PATCH] [FIX] Rewrite the sql query lp bug: https://launchpad.net/bugs/322535 fixed bzr revid: stephane@tinyerp.com-20090129000753-f8vl3vzaklpx8e0i --- addons/account_budget/crossovered_budget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index a609234fc7e..d8212b1da43 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -168,9 +168,10 @@ class crossovered_budget_lines(osv.osv): date_from = context['wizard_date_from'] if context.has_key('wizard_date_to'): date_to = context['wizard_date_to'] + cr.execute("select sum(amount) from account_analytic_line where account_id=%%s and (date " "between to_date(%%s,'yyyy-mm-dd') and to_date(%%s,'yyyy-mm-dd')) and " - "general_account_id in (%s)" % ",".join(['%s']*len(acc_ids)), (line.analytic_account_id.id,date_from,date_to,acc_ids)) + "general_account_id in (%s)" % ",".join(map(str,acc_ids)), (line.analytic_account_id.id, date_from, date_to )) result = cr.fetchone()[0] if result is None: result = 0.00