diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 220fedfac394ee1b65d518dd6d8875645a22ad6e..48061ae235fd0b34538f642cf114f7f216e89680 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -1848,6 +1848,13 @@ class Base( CopyContainer, PortalContent, ActiveObject, Historical, ERP5Property
     else:
       return context.asContext(REQUEST=REQUEST, **kw)
 
+  security.declarePublic('isTempObject')
+  def isTempObject(self):
+    """
+      Tells if an object is temporary or not
+    """
+    return self.reindexObject is self._temp_reindexObject
+
   # Workflow Related Method
   security.declarePublic('getWorkflowStateItemList')
   def getWorkflowStateItemList(self):
diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py
index 6cd4dcada2331e2f1bf32c6411a18cc2594806c2..944fe88253b4cfa682e44c5e583e1aa4ac8d8fef 100644
--- a/product/ERP5Type/ERP5Type.py
+++ b/product/ERP5Type/ERP5Type.py
@@ -21,6 +21,7 @@
 ##############################################################################
 
 from Globals import InitializeClass, DTMLFile
+from exceptions import AccessControl_Unauthorized
 from AccessControl import ClassSecurityInfo, getSecurityManager
 from Acquisition import aq_base, aq_inner, aq_parent
 
@@ -176,6 +177,26 @@ class ERP5TypeInformation( FactoryTypeInformation,
     #
     #   Agent methods
     #
+    def _getFactoryMethod(self, container, check_security=1):
+        if not self.product or not self.factory:
+            raise ValueError, ('Product factory for %s was undefined' %
+                               self.getId())
+        p = container.manage_addProduct[self.product]
+        if hasattr(container, 'isTempObject') and container.isTempObject():
+          factory_name = self.factory
+          factory_name.replace('add', 'newTemp')
+          m = getattr(p, factory_name, None)g
+        else:
+          m = getattr(p, self.factory, None)
+        if m is None:
+            raise ValueError, ('Product factory for %s was invalid' %
+                               self.getId())
+        if not check_security:
+            return m
+        if getSecurityManager().validate(p, p, self.factory, m):
+            return m
+        raise AccessControl_Unauthorized( 'Cannot create %s' % self.getId() )
+    
     security.declarePublic('constructInstance')
     def constructInstance( self, container, id,
                            created_by_builder=0, *args, **kw ):
@@ -189,7 +210,7 @@ class ERP5TypeInformation( FactoryTypeInformation,
         ob = FactoryTypeInformation.constructInstance(
                                              self, container, id, *args, **kw)
 
-        # Only try to assign roles to secutiry groups if some roles are defined
+        # Only try to assign roles to security groups if some roles are defined
         # This is an optimisation to prevent defining local roles on subobjects
         # which acquire their security definition from their parent
         # The downside of this optimisation is that it is not possible to