summaryrefslogtreecommitdiff
path: root/bin/workflow/workitem.py
diff options
context:
space:
mode:
authorced <>2007-07-26 08:31:36 +0000
committerced <>2007-07-26 08:31:36 +0000
commitcfbf7686547d7c9ac2c4165ea5b8d66af3c17b03 (patch)
treee8dec50cc406474504c194e29e6a0282e149cbcd /bin/workflow/workitem.py
parent1029e1323b2a303c707bfc3872abe67744cf310b (diff)
kernel: improve workflow
- add index on workitem, instance - add cache on wkf bzr revid: ced-81afcda4514578d17d998c4e3a8ff516d3346b97
Diffstat (limited to 'bin/workflow/workitem.py')
-rw-r--r--bin/workflow/workitem.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/workflow/workitem.py b/bin/workflow/workitem.py
index b01c9fbed3d..5fbf7ee7fe3 100644
--- a/bin/workflow/workitem.py
+++ b/bin/workflow/workitem.py
@@ -71,7 +71,9 @@ def process(cr, workitem, ident, signal=None, force_running=False):
if trans['trigger_model']:
ids = wkf_expr._eval_expr(cr,ident,workitem,trans['trigger_expr_id'])
for id in ids:
- cr.execute('insert into wkf_triggers (model,res_id,instance_id,workitem_id) values (%s,%d,%d,%d)', (trans['trigger_model'],id,workitem['inst_id'], workitem['id']))
+ cr.execute('select nextval(\'wkf_workitem_id_seq\')')
+ id =cr.fetchone()[0]
+ cr.execute('insert into wkf_triggers (model,res_id,instance_id,workitem_id,id) values (%s,%d,%d,%d,%d)', (trans['trigger_model'],id,workitem['inst_id'], workitem['id'], id))
return True