Commit 8e4d4241 authored by Alexandre Boeglin's avatar Alexandre Boeglin

In most cases, OrderRule will no longer depend on correctly catalogued

simulation, now.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15227 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d96f2be9
...@@ -97,8 +97,17 @@ class OrderRule(DeliveryRule): ...@@ -97,8 +97,17 @@ class OrderRule(DeliveryRule):
existing_movement_list.append(movement) existing_movement_list.append(movement)
immutable_movement_list.append(movement) immutable_movement_list.append(movement)
# this dict simulates getOrderRelatedValue, but it will not work if an
# order was generated from multiple applied rules
order_movement_dict = {}
for s_m in applied_rule.objectValues():
order_movement = s_m.getOrderValue()
if order_movement is not None:
order_movement_dict[order_movement.getPath()] = s_m
# Create or modify movements # Create or modify movements
for movement in order_movement_list: for movement in order_movement_list:
related_order = order_movement_dict.get(movement.getPath(), None)
if related_order is None:
related_order = movement.getOrderRelatedValue() related_order = movement.getOrderRelatedValue()
property_dict = self._getExpandablePropertyDict(applied_rule, movement) property_dict = self._getExpandablePropertyDict(applied_rule, movement)
if related_order is None: if related_order is 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