From 99f214670c09089d43ee2008178e19796d31e12d Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Mon, 26 Jan 2004 14:04:29 +0000
Subject: [PATCH] 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
---
 product/ERP5SyncML/Conduit/ERP5Conduit.py | 35 ++++++++++++-----------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/product/ERP5SyncML/Conduit/ERP5Conduit.py b/product/ERP5SyncML/Conduit/ERP5Conduit.py
index ccc4d9109d..a9c1dd46c9 100755
--- a/product/ERP5SyncML/Conduit/ERP5Conduit.py
+++ b/product/ERP5SyncML/Conduit/ERP5Conduit.py
@@ -727,7 +727,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
         self.addNode(object=object,xml=subnode, force=1)
     # We should first edit the object
     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))
     # edit the object with a dictionnary of arguments,
     # like {"telephone_number":"02-5648"}
@@ -881,20 +881,21 @@ class ERP5Conduit(XMLSyncUtilsMixin):
     Some checking in order to check if we should add the workfow or not
     """
     conflict_list = []
-    action_name = status['action']
-    authorized = 0
-    authorized_actions = wf_tool.getActionsFor(object)
-    LOG('isWorkflowActionAddable, status:',0,status)
-    LOG('isWorkflowActionAddable, authorized_actions:',0,authorized_actions)
-    for action in authorized_actions:
-      if action['id']==action_name:
-        authorized = 1
-    if not authorized:
-      string_io = StringIO()
-      PrettyPrint(xml,stream=string_io)
-      conflict = Conflict(object_path=object.getPhysicalPath(),
-                          keyword=self.history_tag)
-      conflict.setXupdate(string_io.getvalue())
-      conflict.setRemoteValue(status)
-      conflict_list += [conflict]
+    if status.has_key('action'):
+      action_name = status['action']
+      authorized = 0
+      authorized_actions = wf_tool.getActionsFor(object)
+      LOG('isWorkflowActionAddable, status:',0,status)
+      LOG('isWorkflowActionAddable, authorized_actions:',0,authorized_actions)
+      for action in authorized_actions:
+        if action['id']==action_name:
+          authorized = 1
+      if not authorized:
+        string_io = StringIO()
+        PrettyPrint(xml,stream=string_io)
+        conflict = Conflict(object_path=object.getPhysicalPath(),
+                            keyword=self.history_tag)
+        conflict.setXupdate(string_io.getvalue())
+        conflict.setRemoteValue(status)
+        conflict_list += [conflict]
     return conflict_list
-- 
2.30.9