Commit 95def7e5 authored by Jérome Perrin's avatar Jérome Perrin

Adding a quick movement group for movements with same source payment / destination payment.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18778 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cbfd48c8
...@@ -405,6 +405,33 @@ class SectionPathMovementGroup(RootMovementGroup): ...@@ -405,6 +405,33 @@ class SectionPathMovementGroup(RootMovementGroup):
allow_class(SectionPathMovementGroup) allow_class(SectionPathMovementGroup)
class PaymentPathMovementGroup(RootMovementGroup):
""" Groups movement that have the same source_payment and
destination_payment"""
def __init__(self, movement, **kw):
RootMovementGroup.__init__(self, movement=movement, **kw)
source_payment_list = movement.getSourcePaymentList()
destination_payment_list = movement.getDestinationPaymentList()
source_payment_list.sort()
destination_payment_list.sort()
self.source_payment_list = source_payment_list
self.destination_payment_list = destination_payment_list
self.setGroupEdit(
source_payment_list=source_payment_list,
destination_payment_list=destination_payment_list
)
def test(self, movement):
source_payment_list = movement.getSourcePaymentList()
destination_payment_list = movement.getDestinationPaymentList()
source_payment_list.sort()
destination_payment_list.sort()
return source_payment_list == self.source_payment_list and \
destination_payment_list == self.destination_payment_list
class TradePathMovementGroup(RootMovementGroup): class TradePathMovementGroup(RootMovementGroup):
""" """
Group movements that have the same source_trade and the same Group movements that have the same source_trade and the same
......
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