Commit fb9ab20f authored by Arnaud Fontaine's avatar Arnaud Fontaine

Avoid calling interaction workflow when synchronizing objects with ERP5SyncML.

parent 8c853e16
......@@ -984,7 +984,11 @@ class ERP5Conduit(XMLSyncUtilsMixin):
This is the default editDocument method. This method
can easily be overwritten.
"""
object._edit(**kw)
object._v_inhibit_workflow = True
try:
object._edit(**kw)
finally:
object._v_inhibit_workflow = False
security.declareProtected(Permissions.ModifyPortalContent, 'getProperty')
def getProperty(self, object, kw):
......
......@@ -174,6 +174,16 @@ class WorkflowMethod(Method):
# XXX I must think that what is a correct behavior.(Yusei)
return self._m(instance, *args, **kw)
# XXX Ugly hack to avoid calling interaction workflow when synchronizing
# objects with ERP5SyncML as it leads to unwanted side-effects on the
# object being synchronized, such as undesirable workflow history being
# added (for example edit_workflow) and double conversion for OOo
# documents (for example document_conversion_interaction_workflow defined
# for _setData()) making the source and destination XML representation
# different.
if getattr(instance, '_v_inhibit_workflow', False):
return apply(self.__dict__['_m'], (instance,) + args, kw)
# Build a list of transitions which may need to be invoked
instance_path = instance.getPhysicalPath()
portal_type = instance.portal_type
......
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