Commit 5dfd892b authored by Romain Courteaud's avatar Romain Courteaud

Modify build API in order to launch it in activity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3115 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ed1c4e37
...@@ -94,7 +94,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -94,7 +94,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
, PropertySheet.DeliveryBuilder , PropertySheet.DeliveryBuilder
) )
def build(self, applied_rule=None): def build(self, applied_rule_uid=None):
""" """
Build deliveries from a list of movements Build deliveries from a list of movements
...@@ -103,7 +103,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -103,7 +103,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
or to Simulation Movements related to a limited set of existing or to Simulation Movements related to a limited set of existing
""" """
# Select # Select
movement_list = self.selectMovement(applied_rule=applied_rule) movement_list = self.selectMovement(applied_rule_uid=applied_rule_uid)
# Collect # Collect
root_group = self.collectMovement(movement_list) root_group = self.collectMovement(movement_list)
# Build # Build
...@@ -123,7 +123,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -123,7 +123,7 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
return delivery_list return delivery_list
def selectMovement(self, applied_rule=None): def selectMovement(self, applied_rule_uid=None):
""" """
defines how to query all Simulation Movements which meet certain criteria defines how to query all Simulation Movements which meet certain criteria
(including the above path path definition). (including the above path path definition).
...@@ -136,10 +136,8 @@ class DeliveryBuilder(XMLObject, Amount, Predicate): ...@@ -136,10 +136,8 @@ class DeliveryBuilder(XMLObject, Amount, Predicate):
# We only search Simulation Movement # We only search Simulation Movement
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_uid is not None:
# XXX Be sure that applied rule is well indexed kw['parent_uid'] = applied_rule_uid
applied_rule.recursiveImmediateReindexObject()
kw['parent_uid'] = applied_rule.getUid()
# XXX Add profile query # XXX Add profile query
# Add resource query # Add resource query
if self.resource_portal_type not in ('', None): if self.resource_portal_type not in ('', None):
......
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