diff --git a/product/ERP5/Interface/Coordinate.py b/product/ERP5/Interface/Coordinate.py deleted file mode 100644 index 64624b5605297077bd8e5a43719f1c9b102cfed8..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Coordinate.py +++ /dev/null @@ -1,58 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Coordinate(Interface): - """ - Common Interface for all Coordinate objects - """ - - def asText(): - """ - returns the coordinate as a text string - - This method usually tries to lookup a skin named ${PortalType}_asText and - to use this script to display the coordinate text. - """ - pass - - def fromText(coordinate_text): - """ - modifies the coordinate according to the input text. - This method usually tries to lookup a skin named ${PortalType}_fromText and - to use this script to modify the properties of this document. - """ - pass - - def standardTextFormat(): - """ - returns a string which defines the standard - string format for that coordinate - """ - pass diff --git a/product/ERP5/Interface/DivergenceTester.py b/product/ERP5/Interface/DivergenceTester.py deleted file mode 100644 index 8582e710ec32c774520d02a984eca6d93fe8fc7d..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/DivergenceTester.py +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################## -# -# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved. -# Rafael Monnerat <rafael@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class DivergenceTester(Interface): - """ - ERP5 Divergence Tester - """ - - def test(simulation_movement): - """ - This is the fast method to test, return 0 or 1. - It depends if the simulation_movement is divergent or not. - """ - - def explain(simulation_movement): - """ - This method returns a list of messages that contains - the divergence of the Delivery Line. - """ diff --git a/product/ERP5/Interface/Entity.py b/product/ERP5/Interface/Entity.py deleted file mode 100644 index cd6b21039ee70b630bd31ab72b07322670874960..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Entity.py +++ /dev/null @@ -1,107 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Entity(Interface): - """ - Common Interface for Entity objects - """ - - def getDefaultAddress(): - """ - Returns the default address as a text string - """ - pass - - def getDefaultAddressStreetAddress(): - """ - Returns the default address street as a text string - """ - pass - - def getDefaultAddressCity(): - """ - Returns the default address city as a text string - """ - pass - - def getDefaultAddressRegion(): - """ - Returns the default address region as a text string - """ - pass - - def getDefaultAddressZipCode(): - """ - Returns the default address zip code as a text string - """ - pass - - def getDefaultTelephone(): - """ - Returns the default telephone as a text string - """ - pass - - def getDefaultFax(): - """ - Returns the default fax as a text string - """ - pass - - def getDefaultEmail(): - """ - Returns the default email as a text string - """ - pass - - def setDefaultAddress(coordinate): - """ - Updates the default address from a standard text string - """ - pass - - def setDefaultTelephone(coordinate): - """ - Updates the default telephone from a standard text string - """ - pass - - def setDefaultFax(coordinate): - """ - Updates the default fax from a standard text string - """ - pass - - def setDefaultEmail(coordinate): - """ - Updates the default email from a standard text string - """ - pass - diff --git a/product/ERP5/Interface/Expandable.py b/product/ERP5/Interface/Expandable.py deleted file mode 100644 index e7d0e30a7fb38df1af4d85a2139f1ac29445f2e0..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Expandable.py +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Expandable(Interface): - """ - An Expandable class provides methods which trigger - the generation of a root applied rule in the simulation - and its expansion. - """ - - def expand(self, applied_rule_id=None, force=0, activate_kw=None, **kw): - """ - Expand the current Expandable class into the similation - """ diff --git a/product/ERP5/Interface/IAmount.py b/product/ERP5/Interface/IAmount.py deleted file mode 100644 index 43db2ae97069e232126b5cf934d1f8719e68ab2a..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IAmount.py +++ /dev/null @@ -1,154 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 IAmount(Interface): - """Amount interface specification - - An amount represents a quantity of a given resource - in a given quantity unit. Optional efficiency can be - specified in order to represent a loss ratio to take - into account in calculations. Loss ratio is normally - used only in Path. - - The Amount interface is useful each time - we need to add or substract amounts of resources - independently of a movement. This is the case for example - for all Transformation related classes. - - Equations: - net_quantity = quantity * efficiency - - TODO: - 1. make sure getTotalPrice has or does not - have extra parameters (ex. rounding) - 2. remove profit_quantity everywhere - 3. remove target_quantity everywhere - 4. consider how to make Interface compatible - with accessor generation (ex. getResource, - getQuantity, etc.) - 5. consider creating an IPriceable interface - which is common to deliveries and amounts - """ - - # Core API - def getQuantity(): - """ - Returns the quantity of the resource - in the unit specified by the Amount - """ - - def getResource(): - """ - Returns the resource category relative URL - of the Amount - """ - - def getQuantityUnit(): - """ - Returns the quantity unit category relative URL - of the Amount - """ - - def isCancellationAmount(): - """ - A cancellation amount must be interpreted - reversely wrt. to the sign of quantity. - - For example, a negative credit for a cancellation - amount is a negative credit, not a positive - debit. - - A negative production quantity for a cancellation - amount is a cancelled production, not - a consumption - """ - - # Net Quantity API - def getEfficiency(): - """ - Returns the ratio of loss for the given amount. This - is only used in Path such as Transformation. In other - words, efficiency of movements is always 100%. - """ - - def getNetQuantity(): - """ - Returns the quantity multiplied by the ratio. - """ - - # Price API - def getPrice(): - """ - Returns the unit price of the resource - """ - - def getTotalPrice(): - """ - Returns total price ie. the unit price of the resource - multiplied by the quantity. - """ - - # Conversion API - def getConvertedQuantity(): - """ - Returns the quantity of the resource converted in the - management unit of the resource - """ - - def getNetConvertedQuantity(): - """ - Returns the net quantity of the resource converted in the - management unit of the resource - """ - - # Make it possible to add amounts - def __add__(value): - """Add an amount to another amount - - 'value' is an IAmount document - """ - - def __sub__(value): - """Substract an amount from another amount - - 'value' is an IAmount document - """ - - def __mul__(value): - """Multiply an Amount by a float - - 'value' is a float - """ - - def __div__(value): - """Divide an Amount by a float - - 'value' is a float - """ diff --git a/product/ERP5/Interface/IArrow.py b/product/ERP5/Interface/IArrow.py deleted file mode 100644 index dc417e68384b31b92b90427c97861802650f7048..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IArrow.py +++ /dev/null @@ -1,44 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 IArrow(Interface): - """The Arrow lists the methods which are available to - access all source and destination categories of - a movement or of a delivery. - """ - def getSourceArrowBaseCategoryList(): - """Returns all categories which are used to define the source - of this Arrow - """ - - def getDestinationArrowBaseCategoryList(): - """Returns all categories which are used to define the destination - of this Arrow - """ \ No newline at end of file diff --git a/product/ERP5/Interface/IBusinessBuildable.py b/product/ERP5/Interface/IBusinessBuildable.py deleted file mode 100644 index a16247385d54d3e41e4e104612594d476bbcaabb..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IBusinessBuildable.py +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 IBusinessBuildable(Interface): - """Business Buildable interface specification - """ - def isBuildable(explanation): - """Returns True if any of the related Simulation Movement - is buildable and if the predecessor state is completed. - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def isPartiallyBuildable(explanation): - """Returns True if any of the related Simulation Movement - is buildable and if the predecessor state is partially completed. - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def isFrozen(explanation): - """Returns True if all related movements in the simulation - are frozen - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - - XXX - could be redundant with isBuildable - (isFrozen = not isBuildable ?) - """ - - def build(explanation): - """Builds all related movements in the simulation - using the builders of Business Path - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ diff --git a/product/ERP5/Interface/IBusinessCompletable.py b/product/ERP5/Interface/IBusinessCompletable.py deleted file mode 100644 index d1955796908512fa3f473f29add57f6984cb1e4b..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IBusinessCompletable.py +++ /dev/null @@ -1,71 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 IBusinessCompletable(Interface): - """Business Completable interface specification - - Business states and path can be completed or partially completed. - """ - def isCompleted(explanation): - """True if all related simulation movements for this explanation - document are delivered and in simulation state which is considered - as finished. - """ - - def isPartiallyCompleted(explanation): - """True if some related simulation movements for this explanation - document are delivered and in simulation state which is considered - as finished. - """ - - def getExpectedCompletionDate(task): - """Returns the date at which the given state is expected to - be completed, based on the start_date and stop_date of - the given task document. - - 'task' is a document which follows the ITaskGetter interface - (getStartDate, getStopDate) - """ - - def getExpectedCompletionDuration(task): - """Returns the duration at which the the state - if expected to be completed, based on the start_date - and stop_date of the explanation document. - - 'task' is a document which follows the ITaskGetter interface - (getStartDate, getStopDate) - """ - - def getRemainingTradePhaseList(explanation, trade_phase_list=None): - """ - Returns the list of remaining trade phase which to be done on the explanation. - - trade_phase_list -- if provide, the result is filtered by it after collected - """ diff --git a/product/ERP5/Interface/IBusinessPath.py b/product/ERP5/Interface/IBusinessPath.py deleted file mode 100644 index a72178cb6a004a1ca84b3cb80160d77c09ab8de4..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IBusinessPath.py +++ /dev/null @@ -1,57 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Products.ERP5.Interface.IBusinessCompletable import IBusinessCompletable -from Products.ERP5.Interface.IBusinessBuildable import IBusinessBuildable - -class IBusinessPath(IBusinessCompletable, IBusinessBuildable): - """Business Path interface specification - """ - def getExpectedStartDate(task, predecessor_date=None): - """Returns the expected start date for this - path based on the task and provided predecessor_date. - - 'task' is a document which follows the ITaskGetter interface - (getStartDate, getStopDate) and defined the reference dates - for the business process execution - - 'predecessor_date' can be provided as predecessor date and - to override the date provided in the task - """ - - def getExpectedStopDate(task, predecessor_date=None): - """Returns the expected stop date for this - path based on the task and provided predecessor_date. - - 'task' is a document which follows the ITaskGetter interface - (getStartDate, getStopDate) and defined the reference dates - for the business process execution - - 'predecessor_date' can be provided as predecessor date and - to override the date provided in the task - """ diff --git a/product/ERP5/Interface/IBusinessProcess.py b/product/ERP5/Interface/IBusinessProcess.py deleted file mode 100644 index a75290e43f7c3eccb8c6fecd8133de10c0064828..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IBusinessProcess.py +++ /dev/null @@ -1,91 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Products.ERP5.Interface.IBusinessCompletable import IBusinessCompletable -from Products.ERP5.Interface.IBusinessBuildable import IBusinessBuildable - -class IBusinessProcess(IBusinessCompletable, IBusinessBuildable): - """Business Process interface specification - """ - def getBuildablePathValueList(explanation): - """Returns the list of Business Path which are buildable - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getCompletedStateValueList(explanation): - """Returns the list of Business States which are completed - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getPartiallyCompletedStateValueList(explanation): - """Returns the list of Business States which are partially - completed - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getLatestCompletedStateValue(explanation): - """Returns a completed Business State with no succeeding - completed Business Path - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getLatestPartiallyCompletedStateValue(explanation): - """Returns a partially completed Business State with no - succeeding partially completed Business Path - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getLatestCompletedStateValueList(explanation): - """Returns all completed Business State with no succeeding - completed Business Path - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getLatestPartiallyCompletedStateValueList(explanation): - """Returns all partially completed Business State with no - succeeding partially completed Business Path - - 'explanation' is the Order or Item or Document which is the - cause of a root applied rule in the simulation - """ - - def getTradePhaseList(self): - """Returns list of all trade_phase of this Business Process - """ diff --git a/product/ERP5/Interface/IBusinessState.py b/product/ERP5/Interface/IBusinessState.py deleted file mode 100644 index 1715947a1c6e998b7b91c404f250264804b69383..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IBusinessState.py +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Products.ERP5.Interface.IBusinessCompletable import IBusinessCompletable - -class IBusinessState(IBusinessCompletable): - """Business State interface specification - """ diff --git a/product/ERP5/Interface/IMovement.py b/product/ERP5/Interface/IMovement.py deleted file mode 100644 index 0128b03360cc39da2ce37a6cf529c68444b2f577..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/IMovement.py +++ /dev/null @@ -1,163 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 IMovement(Interface): - """Movement interface specification - - A movement represents an amount of resources which - is moved along an Arrow (source and destination). - - Equations: - Production/Consumption - - (A -> B) - production_quantity means nothing - consumption_quantity means nothing - - (A -> Nothing) - if quantity > 0 - consumption_quantity = quantity - production_quantity = 0 - - if quantity < 0 - consumption_quantity = 0 - production_quantity = - quantity - - (Nothing -> B) - if quantity > 0 - consumption_quantity = 0 - production_quantity = quantity - - if quantity < 0 - consumption_quantity = - quantity - production_quantity = 0 - - Credit/Debit - - if quantity > 0 - source_credit = - quantity - source_debit = quantity - destination_credit = quantity - destination_debit = - quantity - - if quantity < 0 - source_credit = quantity - source_debit = - quantity - destination_credit = - quantity - destination_debit = quantity - - TODO: - 1. finish equations (for asset price) - 2. clarify asset value application for multi - currency accunting - 3. clarify the use of asset price in ERP5 - (accounting and outside) since we no - longer store asset price on non accounting - movements - """ - # Helper API for Production - def getConsumptionQuantity(): - """Returns the consumed quantity during - production - """ - - def getProductionQuantity(): - """Returns the produced quantity during - production - """ - - # Helper methods for asset value calculation - def getSourceAssetPrice(): - """Returns the asset price on the source, if defined - XXX - it is unclear if we still use this - """ - - def getDestinationAssetPrice(): - """Returns the asset price on the destination, if defined - XXX - it is unclear if we still use this - """ - - def getSourceInventoriatedTotalAssetPrice(): - """Returns the total asset price for the source, if defined - """ - - def getDestinationInventoriatedTotalAssetPrice(): - """Returns the total asset price for the destination, if defined - """ - - # Helper methods for single currency Accounting (debit / credit) - def getSourceDebit(): - """Returns the source debit in the transaction currency - """ - - def getSourceCredit(): - """Returns the source credit in the transaction currency - """ - - def getDestinationDebit(): - """Returns the destination debit in the transaction currency - """ - - def getDestinationCredit(): - """Returns the destination credit in the transaction currency - """ - - # Helper methods for multi currency Accounting (debit / credit) - def getSourceAssetDebit(): - """Returns the source debit in the source management currency - """ - - def getSourceAssetCredit(): - """Returns the source credit in the source management currency - """ - - def getDestinationAssetDebit(): - """Returns the destination debit in the destination management currency - """ - - def getDestinationAssetCredit(): - """Returns the destination credit in the destination management currency - """ - - def getSourceInventoriatedTotalAssetDebit(): - """Unclear - XXX - """ - - def getSourceInventoriatedTotalAssetCredit(): - """Unclear - XXX - """ - - def getDestinationInventoriatedTotalAssetDebit(): - """Unclear - XXX - """ - - def getDestinationInventoriatedTotalAssetCredit(): - """Unclear - XXX - """ \ No newline at end of file diff --git a/product/ERP5/Interface/ISimulationMovement.py b/product/ERP5/Interface/ISimulationMovement.py deleted file mode 100644 index b85c72675d60c55929bdd3a5cc1b37571a673cbb..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/ISimulationMovement.py +++ /dev/null @@ -1,116 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 ISimulationMovement(Interface): - """Simulation Movement interface specification - - The SimulationMovement interface introduces the option - to define quantity errors between the simulation - and the delivered reality. - - In short: parent applied rules use the Movement - API to define quantity. Child applied rules - should use the Delivered API to access appropriate - quantity values which are take into account the - delivery_error. - - DeliverySolver either solve divergence by - setting the delivery_error (then no target - solver needed, at least for quantity) or - by changing the quantity (then TargetSolver - is needed to backtrack the quantity). - - Equation: - quantity(SM) + delivery_error (SM) = - quantity(DL) * delivery_ratio(SM) - - TODO: - 1. unclear API remaining - """ - - # Delivery API - def getDeliveryRatio(): - """ - Returns ratio to apply on the quantity - property of the corresponding delivery - to obtain the current quantity - """ - - def getDeliveryError(): - """ - Returns correction to make the match - between delivery quantity and simulation - quantity consistent - """ - - def getDeliveryQuantity(): - """ - Returns quantity which was actually shipped, taking - into account the errors of the simulation fixed by - the delivery - - quantity + delivery_error - """ - - def getDeliveryConvertedQuantity(): - """XXX - unclear - """ - - # Divergence API - def isConvergent(): - """Tells whether the simulation movement is convergent - or not, with related delivery - """ - - def isDivergent(): - """Tells whether the simulation movement is divergent - or not, with related delivery - """ - - def getDivergenceList(): - """Returns a list of divergences - XXX - unclear, please explan what the returned documents - or object are (type, class) - """ - - def isFrozen(): - """Tells whether the simulation movement is frozen. - By default, looks up the related Business Process Path - and tells if the simulation state is part of completed - states. - - XXX - should this be renamed isCompleted ? are the - notions of isFrozen and isCompleted same or different ? - """ - - def isSimulated(): - """XXX - unclear - """ - diff --git a/product/ERP5/Interface/ITransformation.py b/product/ERP5/Interface/ITransformation.py deleted file mode 100644 index 74903564f1808d50441ec07e49b87f474da239f3..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/ITransformation.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf8 -*- -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# 艁ukasz Nowak <luke@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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. -# -############################################################################## - -# simple interface which have to be implemented on TradeModelLine, -# Transformation, Pay Sheet Model, etc -from zope.interface import Interface -class ITransformation(Interface): - """ - Common Interface to implementing quering of Indirect Amount - Models (TaxModelLine, InvoiceModelLine) shall be based on this interface - """ - - def getAggregatedAmountList(context, **kw): - """Returns implementation specific AggregatedAmountList of amounts - generated by set of rules - - context - represents object for which calculation shall happen - - **kw - contains implementations specific parameters - - The method returns an instance of AggregatedAmountList class defined - at ERP5/AggregatedAmountList.py - - Note: This method shall be linear in case if context is order, line, - applied rule or movement. In case of built delivery this method shall - be wise enough to CORRECTLY un-linearise calculation, eg. tax is - time dependent, paysheet build from invoices. - """ - pass - - def updateAggregatedAmountList(context, **kw): - """Updates currently existing movements on delivery - - context - represents object on which update shall happen - - **kw - contains implementations specific parameters - - The method return a dict of list of movements : 'movement_to_add_list' and - 'movement_to_delete_list'. - """ - pass - diff --git a/product/ERP5/Interface/OpenOrderExpander.py b/product/ERP5/Interface/OpenOrderExpander.py deleted file mode 100644 index 12192a696da21e2728afc9419ed542af4585e833..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/OpenOrderExpander.py +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# -# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class OpenOrderExpander(Interface): - """ - Any class capable of expanding an Open Order Rule - follows the OpenOrderExpander interface - """ - - def expandOpenOrderRule(applied_rule_id=None, force=0, **kw): - """ - This method is invoked by OpenOrderRule to delegate - the default implementation of expand - """ diff --git a/product/ERP5/Interface/Predicate.py b/product/ERP5/Interface/Predicate.py deleted file mode 100644 index 753a1b09956e6cf1e07bac4cee9fc64fb9a0b5fc..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Predicate.py +++ /dev/null @@ -1,59 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Predicate(Interface): - """ - A Predicate allows to make a statement about a document. - A statement can be related to: - - - the attributes of the document (ex. price >= 3.0) - - - the categories of the document (ex. ) - - The Predicate class is an abstract class, which is - implemented by subclasses. - """ - - def test(context, tested_base_category_list=None): - """A Predicate can be tested on a given context. - - Parameters can passed in order to ignore some conditions: - - tested_base_category_list: this is the list of category that we do - want to test. For example, we might want to test only the - destination or the source of a predicate. - """ - - def asSQLExpression(): - """ - A Predicate can be rendered as an sql expression. This - can be useful to create reporting trees based on the - ZSQLCatalog - """ - diff --git a/product/ERP5/Interface/Rule.py b/product/ERP5/Interface/Rule.py deleted file mode 100644 index 2e6012dc25f8a5404223fad8f0641362ebff9dce..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Rule.py +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Rule(Interface): - """A Rule describes transformations of documents. - """ - - def constructNewAppliedRule(context): - """Create a new applied rule in the context. - - An applied rule is an instanciation of a Rule. The applied rule is - linked to the Rule through the `specialise` relation. - """ - - def expand(applied_rule): - """Expand this applied rule to create new documents inside the - applied rule. - """ - diff --git a/product/ERP5/Interface/Variated.py b/product/ERP5/Interface/Variated.py deleted file mode 100644 index 8855dd8abd408c070440ab1e5cb1047993b479dd..0000000000000000000000000000000000000000 --- a/product/ERP5/Interface/Variated.py +++ /dev/null @@ -1,148 +0,0 @@ -############################################################################## -# -# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. -# Jean-Paul Smets-Solanes <jp@nexedi.com> -# -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability 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 -# garantees and support are strongly adviced 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 Interface import Interface - -class Variated(Interface): - """ - Common Interface for all objects which can be - variated. - """ - - # The following methods are intended to access to the - # variation value of a variated object. Discrete variations - # are based on categories. General variations are encapsulated - # into VariationValue instances. - - # Discrete Variation accessors - def getVariationCategoryList(): - """ - returns a list or relative URLs which defines - a discrete variation (ie. a list of category - memberships) - """ - pass - - def _setVariationCategoryList(node_list): - """ - modifies the discrete variation of an - variated instance by providing a list - of relative URLs - """ - pass - - def setVariationCategoryList(node_list): - """ - modifies the discrete variation of an - variated instance by providing a list - of relative URLs - - reindexes the object - """ - pass - - def getVariationBaseCategoryList(node_list): - """ - returns a list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - def _setVariationBaseCategoryList(node_list): - """ - modifies the list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - def setVariationBaseCategoryList(node_list): - """ - modifies the list of base category ids - which are used to define discrete variations - for this instance - """ - pass - - # General Variation accessors - def getVariationValue(): - """ - Returns a VariationValue object. - """ - pass - - def _setVariationValue(value): - """ - Private setter for VariationValue. - """ - pass - - def setVariationValue(value): - """ - Sets the VariationValue. - """ - pass - - - # The following methods are intended to access the - # variation range of a variated object. A Variation range can - # be defined in a Resource instance or in any object - # which has a relation with a Resource (Amount, Transformation) - - # Discrete Variation Range accessors - - def getVariationRangeCategoryList(base_category_list=(), base=1): - """ - returns a list of categories which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeCategoryItemList(base_category_list=(), - display_id='getTitle', base=1, current_category=None): - """ - returns a list of (category.id, category.display_id()) which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeBaseCategoryList(base_category_list=(), base=1): - """ - returns a list of base categories which are acceptable - as discrete variation values - """ - pass - - def getVariationRangeBaseCategoryItemList(base_category_list=(), - display_id='getTitle', base=1, current_category=None): - """ - returns a list of base category items which are acceptable - as discrete variation values - """ - pass diff --git a/product/ERP5/Interface/__init__.py b/product/ERP5/Interface/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/product/ERP5/interfaces/business_process.py b/product/ERP5/interfaces/business_process.py index 1acc3631c0893deb5f6877bc8426734dc933f1a6..a75290e43f7c3eccb8c6fecd8133de10c0064828 100644 --- a/product/ERP5/interfaces/business_process.py +++ b/product/ERP5/interfaces/business_process.py @@ -85,3 +85,7 @@ class IBusinessProcess(IBusinessCompletable, IBusinessBuildable): 'explanation' is the Order or Item or Document which is the cause of a root applied rule in the simulation """ + + def getTradePhaseList(self): + """Returns list of all trade_phase of this Business Process + """ diff --git a/product/ERP5/interfaces/rule.py b/product/ERP5/interfaces/rule.py index 43c21f1e6fb6b958e6456158dee22e46d681c6b5..2e6012dc25f8a5404223fad8f0641362ebff9dce 100644 --- a/product/ERP5/interfaces/rule.py +++ b/product/ERP5/interfaces/rule.py @@ -1,6 +1,6 @@ ############################################################################## # -# Copyright (c) 2002-2009 Nexedi SA and Contributors. All Rights Reserved. +# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved. # Jean-Paul Smets-Solanes <jp@nexedi.com> # # WARNING: This program as such is intended to be used by professional @@ -37,12 +37,10 @@ class Rule(Interface): An applied rule is an instanciation of a Rule. The applied rule is linked to the Rule through the `specialise` relation. - XXX update params """ def expand(applied_rule): """Expand this applied rule to create new documents inside the applied rule. - XXX update params """