Commit 3cf59847 authored by Jérome Perrin's avatar Jérome Perrin

Add AdministrationPathMovementGroup


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20559 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ef639f6
......@@ -450,6 +450,29 @@ class PaymentPathMovementGroup(RootMovementGroup):
return source_payment_list == self.source_payment_list and \
destination_payment_list == self.destination_payment_list
class AdministrationPathMovementGroup(RootMovementGroup):
""" Groups movement that have the same source_administration and
destination_administration."""
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
source_administration_list = movement.getSourceAdministrationList()
destination_administration_list = movement.getDestinationAdministrationList()
source_administration_list.sort() ; destination_administration_list.sort()
self.source_administration_list = source_administration_list
self.destination_administration_list = destination_administration_list
self.setGroupEdit(
source_administration_list=source_administration_list,
destination_administration_list=destination_administration_list
)
def test(self, movement):
source_administration_list = movement.getSourceAdministrationList()
destination_administration_list = movement.getDestinationAdministrationList()
source_administration_list.sort() ; destination_administration_list.sort()
return source_administration_list == self.source_administration_list and \
destination_administration_list == self.destination_administration_list
class TradePathMovementGroup(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