Commit afcf609b authored by Romain Courteaud's avatar Romain Courteaud

Reindex applied rule before selecting movement.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3063 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ea1e7cd3
...@@ -116,6 +116,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -116,6 +116,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
for movement in root_group.getMovementList(): for movement in root_group.getMovementList():
movement.recursiveReindexObject() movement.recursiveReindexObject()
# Call script on each delivery built
if delivery_after_generation_script_id not in ["", None]: if delivery_after_generation_script_id not in ["", None]:
for delivery in delivery_list: for delivery in delivery_list:
getattr(delivery, delivery_after_generation_script_id)() getattr(delivery, delivery_after_generation_script_id)()
...@@ -136,6 +137,8 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -136,6 +137,8 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
kw['portal_type'] = 'Simulation Movement' kw['portal_type'] = 'Simulation Movement'
# Search only child movement from this applied rule # Search only child movement from this applied rule
if applied_rule is not None: if applied_rule is not None:
# XXX Be sure that applied rule is well indexed
applied_rule.recursiveImmediateReindexObject()
kw['parent_uid'] = applied_rule.getUid() kw['parent_uid'] = applied_rule.getUid()
# XXX Add profile query # XXX Add profile query
# Add resource query # Add resource query
...@@ -148,7 +151,6 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -148,7 +151,6 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
else: else:
select_method = getattr(self, self.simulation_select_method_id) select_method = getattr(self, self.simulation_select_method_id)
movement_list = select_method(kw) movement_list = select_method(kw)
sql_query = select_method(kw, src__=1)
# XXX Use buildSQLQuery will be better # XXX Use buildSQLQuery will be better
movement_list = filter(lambda x: x.getDeliveryRelatedValueList()==[], movement_list = filter(lambda x: x.getDeliveryRelatedValueList()==[],
......
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