[Erp5-report] r18778 - /erp5/trunk/products/ERP5/MovementGroup.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 17 17:55:14 CET 2008


Author: jerome
Date: Thu Jan 17 17:55:13 2008
New Revision: 18778

URL: http://svn.erp5.org?rev=18778&view=rev
Log:
Adding a quick movement group for movements with same source payment / destination payment.


Modified:
    erp5/trunk/products/ERP5/MovementGroup.py

Modified: erp5/trunk/products/ERP5/MovementGroup.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/MovementGroup.py?rev=18778&r1=18777&r2=18778&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/MovementGroup.py (original)
+++ erp5/trunk/products/ERP5/MovementGroup.py Thu Jan 17 17:55:13 2008
@@ -405,6 +405,33 @@
 
 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):
   """
   Group movements that have the same source_trade and the same




More information about the Erp5-report mailing list