[FIX] Close the cursor if open

bzr revid: stephane@tinyerp.com-20081216102403-7kpf1n7rcho3fk1i
This commit is contained in:
Stephane Wirtel 2008-12-16 11:24:03 +01:00
parent 0c3a25a431
commit 348db86e03
1 changed files with 5 additions and 3 deletions

View File

@ -37,9 +37,11 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False)
pool_dic[db_name] = pool
addons.load_modules(db, force_demo, status, update_module)
cr = db.cursor()
pool.init_set(cr, False)
cr.commit()
cr.close()
try:
pool.init_set(cr, False)
cr.commit()
finally:
cr.close()
if not update_module:
import report