Commit 3109299f authored by Sebastien Robin's avatar Sebastien Robin

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
parent cf5ceae3
......@@ -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'):
"""
......
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