Commit 2c3880e2 authored by Jérome Perrin's avatar Jérome Perrin

this is the good version of changeObjectClasses introducted in last

commit (I commited a wrong one ...)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5777 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bb14dd11
......@@ -11,12 +11,12 @@ def fixProductNames(self, REQUEST=None):
contentType.product = 'ERP5Type'
return msg
def changeObjectClass(self, container, object_id, new_class):
"""Creates a copy of object_id inside container, changing its class to
def changeObjectClass(self, object_id, new_class):
"""Creates a copy of object_id inside self, changing its class to
new_class"""
old_obj = container._getObj(object_id)
old_obj = self._getOb(object_id)
self.manage_delObjects([object_id])
new_obj = new_class(object_id)
new_obj.__dict__.update(old_obj.__dict__)
container._setObject(object_id, new_obj)
self._setObject(object_id, new_obj)
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