summaryrefslogtreecommitdiff
path: root/bin/workflow/instance.py
diff options
context:
space:
mode:
authorFabien Pinckaers <fp@tinyerp.com>2008-06-15 00:25:47 +0000
committerFabien Pinckaers <fp@tinyerp.com>2008-06-15 00:25:47 +0000
commit3fe1d6c9ff43d2a99ed4b3a835663b7230f932a6 (patch)
tree0cc2eddd72b586b6373a7e012c799f3b4110fb9d /bin/workflow/instance.py
parent43c5db20d0192afa10d106fd0f57ddc7b87da67b (diff)
Lots of modifs
bzr revid: fp@tinyerp.com-f1b00f3bf53ab89508b79dcf313516f3455ed06c
Diffstat (limited to 'bin/workflow/instance.py')
-rw-r--r--bin/workflow/instance.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/workflow/instance.py b/bin/workflow/instance.py
index 0701ccbcec7..8eb40b6cbd2 100644
--- a/bin/workflow/instance.py
+++ b/bin/workflow/instance.py
@@ -39,7 +39,8 @@ def create(cr, ident, wkf_id):
cr.execute('insert into wkf_instance (id,res_type,res_id,uid,wkf_id) values (%d,%s,%s,%s,%s)', (id_new,res_type,res_id,uid,wkf_id))
cr.execute('select * from wkf_activity where flow_start=True and wkf_id=%d', (wkf_id,))
res = cr.dictfetchall()
- workitem.create(cr, res, id_new, ident)
+ stack = []
+ workitem.create(cr, res, id_new, ident, stack=stack)
update(cr, id_new, ident)
return id_new
@@ -50,13 +51,20 @@ def delete(cr, ident):
def validate(cr, inst_id, ident, signal, force_running=False):
cr.execute("select * from wkf_workitem where inst_id=%d", (inst_id,))
for witem in cr.dictfetchall():
- workitem.process(cr, witem, ident, signal, force_running)
- return _update_end(cr, inst_id, ident)
+ print '-----'
+ stack = []
+ workitem.process(cr, witem, ident, signal, force_running, stack=stack)
+ # An action is returned
+ print '----- Got', stack
+ _update_end(cr, inst_id, ident)
+ return stack and stack[0] or False
def update(cr, inst_id, ident):
cr.execute("select * from wkf_workitem where inst_id=%d", (inst_id,))
for witem in cr.dictfetchall():
- workitem.process(cr, witem, ident)
+ stack = []
+ workitem.process(cr, witem, ident, stack=stack)
+ print 'End Update'
return _update_end(cr, inst_id, ident)
def _update_end(cr, inst_id, ident):