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
No related merge requests found
...@@ -149,22 +149,16 @@ class Order(Delivery): ...@@ -149,22 +149,16 @@ class Order(Delivery):
""" """
Reindex children and simulation 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) 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): def expandAppliedRuleRelatedToOrder(self, activate_kw=None,**kw):
""" """
Expand the applied rule related Expand the applied rule related
""" """
applied_rule = None applied_rule_list = self.getCausalityRelatedValueList(
# XXX getCausalityRelatedValueList can use portal_type parameter portal_type='Applied Rule')
order_causality_list = self.getCausalityRelatedValueList() for applied_rule in applied_rule_list:
for order_causality in order_causality_list:
if order_causality.getPortalType() == 'Applied Rule':
applied_rule = order_causality
if applied_rule is not None:
# XXX Missing activate keys # XXX Missing activate keys
applied_rule.activate(activate_kw=activate_kw).expand(**kw) 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