Commit 23208f41 authored by Sebastien Robin's avatar Sebastien Robin

add a new movement group wich allows to set the causality on lines and cells

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20102 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7479f76
......@@ -259,6 +259,28 @@ class OrderMovementGroup(RootMovementGroup):
allow_class(OrderMovementGroup)
class DefineMovementCausalityMovementGroup(RootMovementGroup):
""" TODO: docstring """
def addCausalityToEdit(self, movement):
order_movement = movement.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=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(DefineMovementCausalityMovementGroup)
class CausalityMovementGroup(RootMovementGroup):
""" TODO: docstring """
......
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