Commit 99f21467 authored by Sebastien Robin's avatar Sebastien Robin

the checker of workflows did not works for every workflows


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@336 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bf985ab7
...@@ -727,7 +727,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -727,7 +727,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
self.addNode(object=object,xml=subnode, force=1) self.addNode(object=object,xml=subnode, force=1)
# We should first edit the object # We should first edit the object
args = self.getFormatedArgs(args=args) args = self.getFormatedArgs(args=args)
LOG('newObject',0,"object.getpath: %s" % str(object.getPath())) LOG('newObject',0,"object.getphyspath: %s" % str(object.getPhysicalPath()))
LOG('newObject',0,"args: %s" % str(args)) LOG('newObject',0,"args: %s" % str(args))
# edit the object with a dictionnary of arguments, # edit the object with a dictionnary of arguments,
# like {"telephone_number":"02-5648"} # like {"telephone_number":"02-5648"}
...@@ -881,20 +881,21 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -881,20 +881,21 @@ class ERP5Conduit(XMLSyncUtilsMixin):
Some checking in order to check if we should add the workfow or not Some checking in order to check if we should add the workfow or not
""" """
conflict_list = [] conflict_list = []
action_name = status['action'] if status.has_key('action'):
authorized = 0 action_name = status['action']
authorized_actions = wf_tool.getActionsFor(object) authorized = 0
LOG('isWorkflowActionAddable, status:',0,status) authorized_actions = wf_tool.getActionsFor(object)
LOG('isWorkflowActionAddable, authorized_actions:',0,authorized_actions) LOG('isWorkflowActionAddable, status:',0,status)
for action in authorized_actions: LOG('isWorkflowActionAddable, authorized_actions:',0,authorized_actions)
if action['id']==action_name: for action in authorized_actions:
authorized = 1 if action['id']==action_name:
if not authorized: authorized = 1
string_io = StringIO() if not authorized:
PrettyPrint(xml,stream=string_io) string_io = StringIO()
conflict = Conflict(object_path=object.getPhysicalPath(), PrettyPrint(xml,stream=string_io)
keyword=self.history_tag) conflict = Conflict(object_path=object.getPhysicalPath(),
conflict.setXupdate(string_io.getvalue()) keyword=self.history_tag)
conflict.setRemoteValue(status) conflict.setXupdate(string_io.getvalue())
conflict_list += [conflict] conflict.setRemoteValue(status)
conflict_list += [conflict]
return conflict_list return conflict_list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment