diff --git a/product/ERP5/Document/OrderLine.py b/product/ERP5/Document/OrderLine.py index 187572bfc3decac98c748bef2d8f1bf55997d254..068e2755e7b205046b09c1fc5b00a4be3470a33a 100755 --- a/product/ERP5/Document/OrderLine.py +++ b/product/ERP5/Document/OrderLine.py @@ -107,9 +107,11 @@ class OrderLine(DeliveryLine): (Called when the object is created or moved.) """ DeliveryLine.manage_afterAdd(self, item, container) - if self.aq_parent.getSimulationState() not in self.getPortalDraftOrderStateList(): - # Only reexpand order rule when we add lines - self.aq_parent.activate()._createOrderRule() + # Make sure we have a workflow with the variable name 'simulation_state' + if getattr(self.getParent(),'getSimulationState'): + if self.getParent().getSimulationState() not in self.getPortalDraftOrderStateList(): + # Only reexpand order rule when we add lines + self.aq_parent.activate()._createOrderRule() # Simulation Consistency Check def getSimulationQuantity(self):