Commit b63ba4ce authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* rename applyToOrderRelatedMovement to applyToDeliveryRelatedMovement and...

* rename applyToOrderRelatedMovement to applyToDeliveryRelatedMovement and keep the original name as the alias.
* try to find delivery related first for better performance in the new simulation hierarchy.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33793 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f6a0f630
...@@ -117,36 +117,39 @@ class Order(Delivery): ...@@ -117,36 +117,39 @@ class Order(Delivery):
kw.setdefault('portal_type', self.getPortalOrderMovementTypeList()) kw.setdefault('portal_type', self.getPortalOrderMovementTypeList())
return Delivery.getTotalQuantity(self, **kw) return Delivery.getTotalQuantity(self, **kw)
def applyToOrderRelatedMovement(self, portal_type='Simulation Movement', \ def applyToDeliveryRelatedMovement(self, portal_type='Simulation Movement',
method_id = 'expand',**kw): method_id='expand',**kw):
""" """
Warning: does not work if it was not catalogued immediately Warning: does not work if it was not catalogued immediately
""" """
# 'order' category is deprecated. it is kept for compatibility. # 'order' category is deprecated. it is kept for compatibility.
for my_simulation_movement in self.getOrderRelatedValueList( for my_simulation_movement in self.getDeliveryRelatedValueList(
portal_type='Simulation Movement') or \ portal_type='Simulation Movement') or \
self.getDeliveryRelatedValueList( self.getOrderRelatedValueList(
portal_type='Simulation Movement'): portal_type='Simulation Movement'):
# And apply # And apply
getattr(my_simulation_movement, method_id)(**kw) getattr(my_simulation_movement, method_id)(**kw)
for m in self.contentValues(filter={'portal_type': \ for m in self.contentValues(filter={'portal_type': \
self.getPortalMovementTypeList()}): self.getPortalMovementTypeList()}):
# Find related in simulation # Find related in simulation
for my_simulation_movement in m.getOrderRelatedValueList( for my_simulation_movement in m.getDeliveryRelatedValueList(
portal_type='Simulation Movement') or \ portal_type='Simulation Movement') or \
m.getDeliveryRelatedValueList( m.getOrderRelatedValueList(
portal_type='Simulation Movement'): portal_type='Simulation Movement'):
# And apply # And apply
getattr(my_simulation_movement, method_id)(**kw) getattr(my_simulation_movement, method_id)(**kw)
for c in m.contentValues(filter={'portal_type': for c in m.contentValues(filter={'portal_type':
self.getPortalMovementTypeList()}): self.getPortalMovementTypeList()}):
for my_simulation_movement in c.getOrderRelatedValueList( for my_simulation_movement in c.getDeliveryRelatedValueList(
portal_type='Simulation Movement') or \ portal_type='Simulation Movement') or \
c.getDeliveryRelatedValueList( c.getOrderRelatedValueList(
portal_type='Simulation Movement'): portal_type='Simulation Movement'):
# And apply # And apply
getattr(my_simulation_movement, method_id)(**kw) getattr(my_simulation_movement, method_id)(**kw)
# 'order' category is deprecated. it is kept for compatibility.
applyToOrderRelatedMovement = applyToDeliveryRelatedMovement
def applyToOrderRelatedAppliedRule(self, method_id='expand',**kw): def applyToOrderRelatedAppliedRule(self, method_id='expand',**kw):
my_applied_rule = self.getCausalityRelatedValue( \ my_applied_rule = self.getCausalityRelatedValue( \
portal_type='Applied Rule') portal_type='Applied Rule')
......
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