Commit 97d6b818 authored by Yusei Tahara's avatar Yusei Tahara

EPR5Type.CopySupport: Support non-ERP5ish objects.

parent accf13dd
Pipeline #7402 running with stage
in 0 seconds
......@@ -506,12 +506,17 @@ class CopyContainer:
# Note: do not use __recurse as it only iterates over immediate content,
# and then stop instead of calling itself into them. It relies on called
# methods to call it back, and we do not want that for _setUid .
# Basically this block of code is for ERP5ish objects only.
todo_list = [new_ob]
while todo_list:
document = todo_list.pop()
todo_list.extend(document.objectValues())
todo_list.extend(document.opaqueValues())
document._setUid(None)
opaqueValues = getattr(document, 'opaqueValues', None)
if opaqueValues is not None:
todo_list.extend(opaqueValues())
_setUid = getattr(document, '_setUid', None)
if _setUid is not None:
_setUid(None)
self._setObject(new_id, new_ob, set_owner=set_owner)
new_ob = self._getOb(new_id)
new_ob._postCopy(self, op=op)
......
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