Use faster join implementation

This commit is contained in:
Cédric Krier committed 2009-08-26 15:58:34 +02:00
1 parent 9a5f15ee28
commit 74f9df047a
1 file changed
+1 -1
+1 -1
View File
@@ -429,7 +429,7 @@ class Invoice(ModelWorkflow, ModelSQL, ModelView):
cursor.execute('SELECT invoice, ' \
'CAST(COALESCE(SUM(amount), 0) AS ' + type_name + ') ' \
'FROM account_invoice_tax ' \
'WHERE invoice IN (' + ','.join(['%s' for x in ids]) + ') ' \
'WHERE invoice IN (' + ','.join(('%s',) * len(ids)) + ') ' \
'GROUP BY invoice', ids)
for invoice_id, sum in cursor.fetchall():
res[invoice_id] = sum