Commit b84f68d3 authored by Jérome Perrin's avatar Jérome Perrin

simplify code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44229 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48c287a5
...@@ -593,7 +593,7 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin): ...@@ -593,7 +593,7 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
'isBuildable') 'isBuildable')
def isBuildable(self): def isBuildable(self):
"""Simulation Movement buildable logic""" """Simulation Movement buildable logic"""
if self.getDeliveryValue() is not None: if self.getDelivery():
# already delivered # already delivered
return False return False
...@@ -815,8 +815,7 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin): ...@@ -815,8 +815,7 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
else: else:
return quantity - profit_quantity + delivery_error return quantity - profit_quantity + delivery_error
return mapping.getMappedProperty(self, property) return mapping.getMappedProperty(self, property)
else: return self.getProperty(property)
return self.getProperty(property)
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'setMappedProperty') 'setMappedProperty')
...@@ -824,5 +823,4 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin): ...@@ -824,5 +823,4 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
mapping = self.getPropertyMappingValue() mapping = self.getPropertyMappingValue()
if mapping is not None: if mapping is not None:
return mapping.setMappedProperty(self, property, value) return mapping.setMappedProperty(self, property, value)
else: return self.setProperty(property, value)
return self.setProperty(property, value)
...@@ -206,4 +206,4 @@ class SubscriptionItem(Item, MovementGeneratorMixin, PeriodicityMixin): ...@@ -206,4 +206,4 @@ class SubscriptionItem(Item, MovementGeneratorMixin, PeriodicityMixin):
id_index += 1 id_index += 1
# And now return result # And now return result
return result return result
\ No newline at end of file
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