Use faster join implementation
This commit is contained in:
1 parent
9a5f15ee28
commit
74f9df047a
1 file changed
+1
-1
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user