Commit a93f2bd3 authored by Sebastien Robin's avatar Sebastien Robin

update the CausalityAssignmentMovementGroup movement group in order to search...

update the CausalityAssignmentMovementGroup movement group in order to search for the order link into the simulation up to the root applied rule

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20178 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6f16692
......@@ -266,22 +266,26 @@ class CausalityAssignmentMovementGroup(RootMovementGroup):
"""
def addCausalityToEdit(self, movement):
order_movement = movement.getOrderValue()
parent = movement
# Go upper into the simulation tree in order to find an order link
while parent.getOrderValue() is None and not(parent.isRootAppliedRule()):
parent = parent.getParentValue()
order_movement = parent.getOrderValue()
if order_movement is not None:
causality = self.getGroupEditDict().get('causality', [])
order_movement_url = order_movement.getRelativeUrl()
if order_movement_url not in causality:
causality.append(order_movement_url)
self.setGroupEdit(causality_list=causality)
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
self.addCausalityToEdit(movement)
def test(self, movement):
self.addCausalityToEdit(movement)
return 1
allow_class(CausalityAssignmentMovementGroup)
class CausalityMovementGroup(RootMovementGroup):
......
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