[FIX] Hr_timesheet_invoice : Query calculation corrected

lp bug: https://launchpad.net/bugs/430043 fixed

bzr revid: jvo@tinyerp.com-20090915153938-2lcgt5kwwhvmayse
This commit is contained in:
Jay (Open ERP) 2009-09-15 21:09:38 +05:30
parent 5ecb23eb53
commit 7a3717d54c
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class account_analytic_account(osv.osv):
res = {}
for account in self.browse(cr, uid, ids):
invoiced = {}
cr.execute('select distinct l.invoice_id from hr_analytic_timesheet h left join account_analytic_line l on (h.line_id=l.id) where account_id=1', (account.id,))
cr.execute('select distinct(l.invoice_id) from hr_analytic_timesheet h left join account_analytic_line l on (h.line_id=l.id) where account_id=%s', (account.id,))
invoice_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
for invoice in self.pool.get('account.invoice').browse(cr, uid, invoice_ids, context):
res.setdefault(account.id, 0.0)