From 3109299f97a68bdf49986118edf55751eeefe562 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 26 Apr 2005 07:49:57 +0000
Subject: [PATCH] we must not assume that we always have the getSimulationState
 method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2951 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/DeliveryLine.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/product/ERP5/Document/DeliveryLine.py b/product/ERP5/Document/DeliveryLine.py
index 4924dc1c6e..d24e57ae79 100755
--- a/product/ERP5/Document/DeliveryLine.py
+++ b/product/ERP5/Document/DeliveryLine.py
@@ -83,7 +83,9 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated):
       """
         Explicitly acquire simulation_state from parent
       """
-      return self.aq_parent.getSimulationState()
+      if hasattr(self.getParent(),'getSimulationState'):
+        return self.getParent().getSimulationState()
+      return None
     
     # Force in _edit to modify variation_base_category_list first
     security.declarePrivate( '_edit' )
@@ -141,15 +143,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated):
         aggregate = self.DeliveryLine_zGetTotal()[0]
         return aggregate.total_quantity or 0.0
 
-    # Cell Related
-    security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
-    def newCellContent(self, id, **kw):
-      """
-          This method can be overriden
-      """
-      self.invokeFactory(type_name="Delivery Cell",id=id)
-      return self.get(id)
-
     security.declareProtected( Permissions.ModifyPortalContent, 'hasCellContent' )
     def hasCellContent(self, base_id='movement'):
       """
-- 
2.30.9