Commit 584852fd authored by Arnaud Fontaine's avatar Arnaud Fontaine

newTemp*() deprecation (1bce8563, 04b49859): Add DeprecationWarning when calling...

newTemp*() deprecation (1bce8563, 04b49859): Add DeprecationWarning when calling a newTemp*() function.
parent d47c0d82
...@@ -1021,12 +1021,13 @@ def importLocalDocument(class_id, path=None, class_path=None): ...@@ -1021,12 +1021,13 @@ def importLocalDocument(class_id, path=None, class_path=None):
setattr(Products.ERP5Type.Document, class_id, module) setattr(Products.ERP5Type.Document, class_id, module)
### newTempFoo ### newTempFoo
temp_document_constructor_name = "newTemp%s" % class_id
from Products.ERP5Type.ERP5Type import ERP5TypeInformation from Products.ERP5Type.ERP5Type import ERP5TypeInformation
klass = getattr(module, class_id) klass = getattr(module, class_id)
temp_type = ERP5TypeInformation(klass.portal_type) temp_document_constructor = deprecated(
temp_document_constructor = temp_type.constructTempInstance ('newTemp*(self, ID) will be removed, use self.newContent('
'temp_object=True, id=ID, portal_type=...)'))(
temp_document_constructor_name = "newTemp%s" % class_id ERP5TypeInformation(klass.portal_type).constructTempInstance)
setattr(Products.ERP5Type.Document, setattr(Products.ERP5Type.Document,
temp_document_constructor_name, temp_document_constructor_name,
temp_document_constructor) temp_document_constructor)
......
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