[IMP] workflow: remove useless cr.commit() calls, commit is done by server during addons init, and anyway if it is part of an RPC transaction it would be commited too at end of transaction. One should never commit explicitly unless you have created your own cursor or you are in the server and you know what you are doing.

bzr revid: odo@openerp.com-20100712142035-gfuggrkcko62si3z
This commit is contained in:
Olivier Dony 2010-07-12 16:20:35 +02:00
parent a967c6e21f
commit 96ccd8720c
1 changed files with 0 additions and 3 deletions

View File

@ -174,11 +174,9 @@ class wkf_instance(osv.osv):
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'wkf_instance_res_id_res_type_state_index\'')
if not cr.fetchone():
cr.execute('CREATE INDEX wkf_instance_res_id_res_type_state_index ON wkf_instance (res_id, res_type, state)')
cr.commit()
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'wkf_instance_res_id_wkf_id_index\'')
if not cr.fetchone():
cr.execute('CREATE INDEX wkf_instance_res_id_wkf_id_index ON wkf_instance (res_id, wkf_id)')
cr.commit()
wkf_instance()
@ -210,7 +208,6 @@ class wkf_triggers(osv.osv):
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'wkf_triggers_res_id_model_index\'')
if not cr.fetchone():
cr.execute('CREATE INDEX wkf_triggers_res_id_model_index ON wkf_triggers (res_id, model)')
cr.commit()
wkf_triggers()