[FIX] Fixed incorrect psycopg2 usage for passing query parameters.
authorOlivier Dony <odo@openerp.com>
Thu, 8 Apr 2010 00:07:39 +0000 (02:07 +0200)
committerOlivier Dony <odo@openerp.com>
Thu, 8 Apr 2010 00:07:39 +0000 (02:07 +0200)
Improves on fix by rev 2174 fp@tinyerp.com-20100407070419-4cly41c0bvrkd00v
(with bad commit message BTW)

bzr revid: odo@openerp.com-20100408000739-3f8oe65bcinfpliu

bin/osv/orm.py

index c5a36be..9642d8a 100644 (file)
@@ -2934,7 +2934,7 @@ class orm(orm_template):
         self.check_access_rule(cr, uid, ids, 'unlink', context=context)
         for sub_ids in cr.split_for_in_conditions(ids):
             cr.execute('delete from ' + self._table + ' ' \
-                       'where id in ('+','.join(['%s'] * len(sub_ids))+')', sub_ids)
+                       'where id in %s', (sub_ids,))
         for order, object, store_ids, fields in result_store:
             if object != self._name:
                 obj =  self.pool.get(object)