Commit 1ace130b authored by Fabien Morin's avatar Fabien Morin

Make possible to pass a movement list to build method. In this way, it is...

Make possible to pass a movement list to build method. In this way, it is possible to invoke build without using simulation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27082 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 42842fbc
...@@ -96,7 +96,7 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -96,7 +96,7 @@ class OrderBuilder(XMLObject, Amount, Predicate):
security.declarePublic('build') security.declarePublic('build')
def build(self, applied_rule_uid=None, movement_relative_url_list=None, def build(self, applied_rule_uid=None, movement_relative_url_list=None,
delivery_relative_url_list=None,**kw): delivery_relative_url_list=None, movement_list=None, **kw):
""" """
Build deliveries from a list of movements Build deliveries from a list of movements
...@@ -109,16 +109,19 @@ class OrderBuilder(XMLObject, Amount, Predicate): ...@@ -109,16 +109,19 @@ class OrderBuilder(XMLObject, Amount, Predicate):
movement_relative_url_list = [] movement_relative_url_list = []
if delivery_relative_url_list is None: if delivery_relative_url_list is None:
delivery_relative_url_list = [] delivery_relative_url_list = []
if movement_list is None:
movement_list = []
# Call a script before building # Call a script before building
self.callBeforeBuildingScript() self.callBeforeBuildingScript()
# Select # Select
if len(movement_relative_url_list) == 0: if not len(movement_list):
movement_list = self.searchMovementList( if len(movement_relative_url_list) == 0:
delivery_relative_url_list=delivery_relative_url_list, movement_list = self.searchMovementList(
applied_rule_uid=applied_rule_uid,**kw) delivery_relative_url_list=delivery_relative_url_list,
else: applied_rule_uid=applied_rule_uid,**kw)
movement_list = [self.restrictedTraverse(relative_url) for relative_url \ else:
in movement_relative_url_list] movement_list = [self.restrictedTraverse(relative_url) for relative_url \
in movement_relative_url_list]
# Collect # Collect
root_group_node = self.collectMovement(movement_list) root_group_node = self.collectMovement(movement_list)
# Build # Build
......
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