Commit dda171ce authored by Romain Courteaud's avatar Romain Courteaud

Expand Order in activity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13453 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 07ef84cf
......@@ -149,22 +149,16 @@ class Order(Delivery):
"""
Reindex children and simulation
"""
# XXX Fixme: recursiveReindexObject is called during object creation
# It makes object creation slow, because it calls the catalog each time
# Now the applied rule is expanded
Delivery.recursiveReindexObject(self, activate_kw=activate_kw, *k, **kw)
self.expandAppliedRuleRelatedToOrder(activate_kw=activate_kw, **kw)
self.activate(activate_kw=activate_kw).\
expandAppliedRuleRelatedToOrder(activate_kw=activate_kw, **kw)
def expandAppliedRuleRelatedToOrder(self, activate_kw=None,**kw):
"""
Expand the applied rule related
"""
applied_rule = None
# XXX getCausalityRelatedValueList can use portal_type parameter
order_causality_list = self.getCausalityRelatedValueList()
for order_causality in order_causality_list:
if order_causality.getPortalType() == 'Applied Rule':
applied_rule = order_causality
if applied_rule is not None:
applied_rule_list = self.getCausalityRelatedValueList(
portal_type='Applied Rule')
for applied_rule in applied_rule_list:
# XXX Missing activate keys
applied_rule.activate(activate_kw=activate_kw).expand(**kw)
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