[Erp5-report] r30607 - /erp5/trunk/products/ERP5/interfaces/movement_generator.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Nov 13 23:15:34 CET 2009


Author: jp
Date: Fri Nov 13 23:15:34 2009
New Revision: 30607

URL: http://svn.erp5.org?rev=30607&view=rev
Log:
Initial upload.

Added:
    erp5/trunk/products/ERP5/interfaces/movement_generator.py

Added: erp5/trunk/products/ERP5/interfaces/movement_generator.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/movement_generator.py?rev=30607&view=auto
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/movement_generator.py (added)
+++ erp5/trunk/products/ERP5/interfaces/movement_generator.py [utf8] Fri Nov 13 23:15:34 2009
@@ -1,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
+#                    Jean-Paul Smets-Solanes <jp at nexedi.com>
+#                    Łukasz Nowak <luke at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsibility of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# guarantees and support are strongly advised to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+from zope.interface import Interface
+
+class IMovementGenerator(Interface):
+  """Movement Generator interface specification
+  
+  Documents which implement IMovementGenerator
+  can be used to generate an IMovementList from
+  an existing IMovementCollection, IMovementList or
+  IMovement. Typical IMovementGenerator are Rules
+  and Trade Conditions.
+  """
+
+  def getAggregatedMovementList(context, movement_list=None, rounding=False):
+    """
+    Returns an IMovementList generated by a model a model applied to the
+    context.
+
+    context - an IMovementCollection, an IMovementList or an IMovement
+
+    movement_list - optional IMovementList which can be passed explicitely
+                    whenever context is an IMovementCollection and whenever
+                    we want to filter context.geMovementList
+
+    rounding - boolean argument, which controls if rounding shall be applied on
+               generated movements or not
+
+    NOTE:
+      - implement rounding appropriately (True or False seems 
+        simplistic)
+    """




More information about the Erp5-report mailing list