From 96ccd8720c9450e1af4017d4b14a45ef771ec073 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 12 Jul 2010 16:20:35 +0200 Subject: [PATCH] [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 --- bin/addons/base/ir/workflow/workflow.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/addons/base/ir/workflow/workflow.py b/bin/addons/base/ir/workflow/workflow.py index 2a551e9549f..7518700a3c3 100644 --- a/bin/addons/base/ir/workflow/workflow.py +++ b/bin/addons/base/ir/workflow/workflow.py @@ -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()