Commit ace56db3 authored by Aurel's avatar Aurel

in preinstall for workflow, diff all subobjects to know if workflow is modified


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5553 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0efd1e02
...@@ -956,23 +956,23 @@ class WorkflowTemplateItem(ObjectTemplateItem): ...@@ -956,23 +956,23 @@ class WorkflowTemplateItem(ObjectTemplateItem):
portal = context.getPortalObject() portal = context.getPortalObject()
new_keys = self._objects.keys() new_keys = self._objects.keys()
for path in new_keys: for path in new_keys:
if len(path.split('/')) == 2: if installed_bt._objects.has_key(path):
if installed_bt._objects.has_key(path): # compare object to see it there is changes
# compare object to see it there is changes new_object = self._objects[path]
new_object = self._objects[path] old_object = installed_bt._objects[path]
old_object = installed_bt._objects[path] new_io = StringIO()
new_io = StringIO() old_io = StringIO()
old_io = StringIO() OFS.XMLExportImport.exportXML(new_object._p_jar, new_object._p_oid, new_io)
OFS.XMLExportImport.exportXML(new_object._p_jar, new_object._p_oid, new_io) OFS.XMLExportImport.exportXML(old_object._p_jar, old_object._p_oid, old_io)
OFS.XMLExportImport.exportXML(old_object._p_jar, old_object._p_oid, old_io) new_obj_xml = new_io.getvalue()
new_obj_xml = new_io.getvalue() old_obj_xml = old_io.getvalue()
old_obj_xml = old_io.getvalue() new_io.close()
new_io.close() old_io.close()
old_io.close() if new_obj_xml != old_obj_xml:
if new_obj_xml != old_obj_xml: wf_id = path.split('/')[:2]
modified_object_list.update({path : ['Modified', 'Workflow']}) modified_object_list.update({'/'.join(wf_id) : ['Modified', 'Workflow']})
else: # new object else: # new object
modified_object_list.update({path : ['New', 'Workflow']}) modified_object_list.update({path : ['New', 'Workflow']})
# get removed object # get removed object
old_keys = installed_bt._objects.keys() old_keys = installed_bt._objects.keys()
for path in old_keys: for path in old_keys:
......
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